Skip to content

Commit

Permalink
Fix flaky timeout test
Browse files Browse the repository at this point in the history
  • Loading branch information
jhalterman committed Feb 8, 2022
1 parent 142fe57 commit 5356370
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/test/java/dev/failsafe/functional/TimeoutTest.java
Expand Up @@ -206,7 +206,7 @@ public void testFallbackTimeoutWithBlockedSupplier() {
fbStats.reset();
}, Failsafe.with(fallback).compose(timeout), ctx -> {
System.out.println("Executing");
Thread.sleep(100);
Thread.sleep(200);
throw new Exception();
}, (f, e) -> {
assertEquals(e.getAttemptCount(), 1);
Expand All @@ -216,11 +216,11 @@ public void testFallbackTimeoutWithBlockedSupplier() {
}, IllegalStateException.class);

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

// Test with interrupt
timeout = withStatsAndLogs(Timeout.builder(Duration.ofMillis(1)).withInterrupt(), timeoutStats).build();
timeout = withStatsAndLogs(Timeout.builder(Duration.ofMillis(100)).withInterrupt(), timeoutStats).build();
test.accept(timeout);
}

Expand Down

0 comments on commit 5356370

Please sign in to comment.