Skip to content

Commit 0b520bd

Browse files
committed
Fixing undeterministic behavior in shouldApplyConnectTimeoutPerRoute() test
Signed-off-by: Rodolfo Juarez <[email protected]>
1 parent c8a1ea4 commit 0b520bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-cloud-gateway-server-webflux/src/test/java/org/springframework/cloud/gateway/filter/NettyRoutingFilterIntegrationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040

4141
import static org.assertj.core.api.Assertions.assertThat;
4242
import static org.assertj.core.api.Assertions.assertThatThrownBy;
43-
import static org.assertj.core.data.Offset.offset;
4443
import static org.hamcrest.Matchers.containsString;
4544
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
4645

@@ -133,7 +132,8 @@ public void shouldApplyConnectTimeoutPerRoute() {
133132

134133
// default connect timeout is 45 sec, this test verifies that it is possible to
135134
// reduce timeout via config
136-
assertThat(System.currentTimeMillis() - currentTimeMillisBeforeCall).isCloseTo(5, offset(100L));
135+
long duration = System.currentTimeMillis() - currentTimeMillisBeforeCall;
136+
assertThat(duration).isLessThan(5000L);
137137
}
138138

139139
@Test

0 commit comments

Comments
 (0)