Skip to content

Commit b19c626

Browse files
committed
Attempt to fix flaky async tests
1 parent 265535e commit b19c626

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/test/java/net/jodah/failsafe/AbstractFailsafeTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public void shouldTimeoutAndCancel() throws Throwable {
296296
Timeout<Object> timeout = Timeout.of(Duration.ofMillis(1)).withCancel(false);
297297
ContextualSupplier supplier = ctx -> {
298298
if (ctx.getAttemptCount() != 2) {
299-
Thread.sleep(100);
299+
Thread.sleep(200);
300300
waiter.assertTrue(ctx.isCancelled());
301301
} else
302302
waiter.assertFalse(ctx.isCancelled()); // Cancellation should be cleared on last attempt

src/test/java/net/jodah/failsafe/issues/Issue242Test.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
@Test
1212
public class Issue242Test {
13-
public void test() throws Throwable {
13+
public void shouldDelayOnExplicitRetry() throws Throwable {
1414
RetryPolicy<String> retryPolicy = new RetryPolicy<String>().handleResult(null)
15-
.withDelay(Duration.ofMillis(100))
15+
.withDelay(Duration.ofMillis(110))
1616
.withMaxAttempts(3);
1717

1818
long startTime = System.currentTimeMillis();

0 commit comments

Comments
 (0)