From 510c07c11675f613027f78f90673a1b2203b929c Mon Sep 17 00:00:00 2001 From: William Burns Date: Tue, 14 May 2019 13:29:36 -0400 Subject: [PATCH] ISPN-10086 AllClusterExecutorTest.testExecutorTriConsumerTimeoutException random failures --- .../java/org/infinispan/manager/AllClusterExecutorTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/test/java/org/infinispan/manager/AllClusterExecutorTest.java b/core/src/test/java/org/infinispan/manager/AllClusterExecutorTest.java index dcf533a93db1..e4494a2b66b4 100644 --- a/core/src/test/java/org/infinispan/manager/AllClusterExecutorTest.java +++ b/core/src/test/java/org/infinispan/manager/AllClusterExecutorTest.java @@ -388,6 +388,7 @@ public void call() throws InterruptedException, ExecutionException, TimeoutExcep try { checkPoint.get().trigger("block_execution"); checkPoint.get().awaitStrict("resume_execution", 10, TimeUnit.SECONDS); + checkPoint.get().trigger("complete"); } catch (InterruptedException | TimeoutException e) { throw new TestException(e); } @@ -403,6 +404,9 @@ public void call() throws InterruptedException, ExecutionException, TimeoutExcep Exceptions.expectExecutionException(org.infinispan.util.concurrent.TimeoutException.class, futureRemote); checkPoint.get().awaitStrict("block_execution", 10, TimeUnit.SECONDS); checkPoint.get().trigger("resume_execution"); + // Have to wait for callback to complete - otherwise a different thread could find the "resume_execution" + // checkpoint reached incorrectly + checkPoint.get().awaitStrict("complete", 10, TimeUnit.SECONDS); CompletableFuture futureLocal = executor(cm1).filterTargets(a -> a.equals(cm1.getAddress())) @@ -413,6 +417,7 @@ public void call() throws InterruptedException, ExecutionException, TimeoutExcep Exceptions.expectExecutionException(org.infinispan.util.concurrent.TimeoutException.class, futureLocal); checkPoint.get().awaitStrict("block_execution", 10, TimeUnit.SECONDS); checkPoint.get().trigger("resume_execution"); + checkPoint.get().awaitStrict("complete", 10, TimeUnit.SECONDS); } }); }