Skip to content

Commit

Permalink
Attempt to fix flaky async tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jhalterman committed Apr 30, 2020
1 parent 265535e commit b19c626
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/test/java/net/jodah/failsafe/AbstractFailsafeTest.java
Expand Up @@ -296,7 +296,7 @@ public void shouldTimeoutAndCancel() throws Throwable {
Timeout<Object> timeout = Timeout.of(Duration.ofMillis(1)).withCancel(false);
ContextualSupplier supplier = ctx -> {
if (ctx.getAttemptCount() != 2) {
Thread.sleep(100);
Thread.sleep(200);
waiter.assertTrue(ctx.isCancelled());
} else
waiter.assertFalse(ctx.isCancelled()); // Cancellation should be cleared on last attempt
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/net/jodah/failsafe/issues/Issue242Test.java
Expand Up @@ -10,9 +10,9 @@

@Test
public class Issue242Test {
public void test() throws Throwable {
public void shouldDelayOnExplicitRetry() throws Throwable {
RetryPolicy<String> retryPolicy = new RetryPolicy<String>().handleResult(null)
.withDelay(Duration.ofMillis(100))
.withDelay(Duration.ofMillis(110))
.withMaxAttempts(3);

long startTime = System.currentTimeMillis();
Expand Down

0 comments on commit b19c626

Please sign in to comment.