Skip to content

Commit 5356370

Browse files
committed
Fix flaky timeout test
1 parent 142fe57 commit 5356370

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/test/java/dev/failsafe/functional/TimeoutTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public void testFallbackTimeoutWithBlockedSupplier() {
206206
fbStats.reset();
207207
}, Failsafe.with(fallback).compose(timeout), ctx -> {
208208
System.out.println("Executing");
209-
Thread.sleep(100);
209+
Thread.sleep(200);
210210
throw new Exception();
211211
}, (f, e) -> {
212212
assertEquals(e.getAttemptCount(), 1);
@@ -216,11 +216,11 @@ public void testFallbackTimeoutWithBlockedSupplier() {
216216
}, IllegalStateException.class);
217217

218218
// Test without interrupt
219-
Timeout<Object> timeout = withStatsAndLogs(Timeout.builder(Duration.ofMillis(1)), timeoutStats).build();
219+
Timeout<Object> timeout = withStatsAndLogs(Timeout.builder(Duration.ofMillis(100)), timeoutStats).build();
220220
test.accept(timeout);
221221

222222
// Test with interrupt
223-
timeout = withStatsAndLogs(Timeout.builder(Duration.ofMillis(1)).withInterrupt(), timeoutStats).build();
223+
timeout = withStatsAndLogs(Timeout.builder(Duration.ofMillis(100)).withInterrupt(), timeoutStats).build();
224224
test.accept(timeout);
225225
}
226226

0 commit comments

Comments
 (0)