-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-26217 Clean shared state pollution to avoid flaky tests. #3615
base: master
Are you sure you want to change the base?
Conversation
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
Thanks for the PR. It is always good that we have developers want to clean up tests code. But what I do not understand is, we always create a new TaskMonitor in every test method, so how could it mess up later tests run? Looking at the code in TaskMonitor, we do not have static field in this class? Thanks. |
In test There are 2 kinds of fixes:
|
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
What is the purpose of this PR
This PR cleans the state polluted by
org.apache.hadoop.hbase.monitoring.TestTaskMonitor.testDoNotPurgeRPCTask
.It may be better to clean state pollutions so that some other tests won't fail in the future due to the shared state pollution.
Reproduce the test failure
Expected result:
Actual result:
[ERROR] Failures: [ERROR] testDoNotPurgeRPCTask:144 RPC Tasks have been purged! expected:<10> but was:<20>
Why the test fails
rpcTasks
, butrpcTasks
is not completely purged when the test ends. So next time the test starts, the remaining RPC tasks lead to an assertion failure.Fix
TaskMonitor
each time to avoid pollution similar to the other tests (e.g.,testTaskMonitorBasics
,testTasksGetAbortedOnLeak
) inTestTaskMonitor
. Create a new TaskMonitor each time to avoid flaky tests. LALAYANG/hbase#1Please let me know which fix you think is better. Thanks!
Issue link: https://issues.apache.org/jira/browse/HBASE-26217