[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
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