LALAYANG opened a new pull request #3615:
URL: https://github.com/apache/hbase/pull/3615


   ## 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
   - Run the test twice in the same JVM. 
   ## Expected  result:
   - The tests should run successfully when multiple tests that use this state 
are run in the same JVM.
   ## Actual result:
   - We get the failure:
   `[ERROR] Failures: 
   [ERROR] testDoNotPurgeRPCTask:144 RPC Tasks have been purged! expected:<10> 
but was:<20>`
   ## Why the test fails
   - Each time this test runs,10 RPCtasks are created and added to the 
ArrayList `rpcTasks`, but `rpcTasks` is not completely purged when the test 
ends. So next time the test starts, the remaining RPC tasks lead to an 
assertion failure.
   ## Fix
   - Clean all tasks when the test ends.
   - Another solution is to create a new `TaskMonitor` each time to avoid 
pollution similar to the other tests (e.g., `testTaskMonitorBasics`, 
`testTasksGetAbortedOnLeak`) in `TestTaskMonitor`. 
https://github.com/LALAYANG/hbase/pull/1
   
   Please let me know which fix you think is better. Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to