Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISPN-10086 AllClusterExecutorTest.testExecutorTriConsumerTimeoutExcep… #6913

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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);
}
Expand All @@ -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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wburns I think the comment is unnecessarily vague about which "different thread" is going to find the checkpoint, and also the name "complete" sounds wrong because the callback is still not done at the point the checkpoint is triggered. Maybe it would have been simpler to just use a different callback for the second submitConsumer call, with different event names?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depends upon your definition of simpler, this change only requires 3 lines, the other would require quite a few more.

The reason for the ambiguity of "different thread" is because we don't really know what thread the AllClusterExecutorTest may use at this point. Also the callback is effectively done when triggering this checkpoint as there is no more code for the lambda to invoke.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant even if it requires more changes, the final result would be simpler, because different test methods cannot influence each other. Isn't the uncertainty about which thread consumes the event caused solely by callback from earlier potentially still running?


CompletableFuture<Void> futureLocal =
executor(cm1).filterTargets(a -> a.equals(cm1.getAddress()))
Expand All @@ -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);
}
});
}
Expand Down