-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Tests] Fix flaky test GracefulExecutorServicesShutdownTest #10599
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
[Tests] Fix flaky test GracefulExecutorServicesShutdownTest #10599
Conversation
- fix race condition in test by adding a CountDownLatch to verify that execution has entered the awaitTermination method before the future is cancelled
...ker/src/test/java/org/apache/pulsar/broker/service/GracefulExecutorServicesShutdownTest.java
Show resolved
Hide resolved
Yes, I agree that. |
|
@linlinnn I have merged this patch in order to unblock CI. |
|
ok |
I don't see how this could happen. Interrupting a thread doesn't stop execution. It sets the interrupted status and interrupts any blocking methods such as sleep or blocking IO with an InterruptedException. Calling countDown will never be interrupted. |
|
@lhotari |
No worries, the mocking was quite unexpected for executor.awaitTermination. btw. It seems that this test became very flaky after the switch to JDK11. To get the fix to other PRs, it is either necessary to rebase or close and re-open a PR so that the changes get picked up. When re-running a failed build it won't pick up changes made into master branch. New PR builds or reopened PR builds will pick up changes. |
…0599) - fix race condition in test by adding a CountDownLatch to verify that execution has entered the awaitTermination method before the future is cancelled
Motivation
GracefulExecutorServicesShutdownTest'sshouldTerminateWhenFutureIsCancelledremains flaky after #10592 .Example failure: https://github.com/apache/pulsar/pull/10598/checks?check_run_id=2590214027#step:10:1341
Modifications