-
Notifications
You must be signed in to change notification settings - Fork 902
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
Speed the Auditor test end time. #4081
Speed the Auditor test end time. #4081
Conversation
@horizonzy Would you please address the check style issue? |
My question is why the auditor is blocked for 30 seconds? |
`
The |
This PR is a little customized, close it. |
@@ -620,7 +622,7 @@ public void shutdown() { | |||
LOG.info("Shutting down auditor"); | |||
executor.shutdown(); | |||
try { | |||
while (!executor.awaitTermination(30, TimeUnit.SECONDS)) { | |||
while (!executor.awaitTermination(awaitTermination, TimeUnit.SECONDS)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will wait at most 30s before enter the shutdownNow logic, not wait at least 30s.
Motivation
In some tests, the execution time can be quite long, even though the test methods have already finished running. For example, in the AuditorRollingRestartTest#testAuditingDuringRollingRestart() test.
I printed out the stack trace and found that it is stuck at executor.awaitTermination(30, TimeUnit.SECONDS) i
n the Auditor. In some tests, the executor in the Auditor is getting stuck, causing the test to wait for an additional 30 seconds.
Therefore, we can modify the behavior of awaitTermination using a system variable, so that it doesn't wait for 30 seconds when running in a single-sided mode.