Skip to content

Commit c285214

Browse files
committed
Fix flaky test where Timeout occurs before execution begins
1 parent 245bfc4 commit c285214

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/java/net/jodah/failsafe/functional/TimeoutTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,14 +317,14 @@ public void testFallbackThenTimeoutWithBlockedSupplier() {
317317
public void testFallbackThenTimeoutWithBlockedFallback() {
318318
AtomicInteger timeoutCounter = new AtomicInteger();
319319
AtomicInteger fallbackCounter = new AtomicInteger();
320-
Timeout<Object> timeout = Timeout.of(Duration.ofMillis(1)).onFailure(e -> {
320+
Timeout<Object> timeout = Timeout.of(Duration.ofMillis(100)).onFailure(e -> {
321321
System.out.println("Timed out");
322322
timeoutCounter.incrementAndGet();
323323
});
324324
Fallback<Object> fallback = Fallback.of(() -> {
325325
System.out.println("Falling back");
326326
fallbackCounter.incrementAndGet();
327-
Thread.sleep(100);
327+
Thread.sleep(200);
328328
throw new IllegalStateException();
329329
});
330330

0 commit comments

Comments
 (0)