lzx404243 opened a new pull request #2984: URL: https://github.com/apache/hbase/pull/2984
The test `org.apache.hadoop.hbase.master.cleaner.TestReplicationHFileCleaner.testIsFileDeletable` is not idempotent and fail if run twice in the same JVM, because it pollutes some states shared among tests. It may be good to clean this state pollution so that some other tests do not fail in the future due to the shared state polluted by this test. ### Detail Running `TestReplicationHFileCleaner.testIsFileDeletable` twice would result in the second run failing due to the following assertion error: ``` java.lang.AssertionError: Cleaner should allow to delete this file as there is no hfile reference node for it in the queue. ``` The root cause is that the a hfile reference is set during the first test run, which doesn't get removed upon test exits. Therefore, in the second test run , `cleaner.isFileDeletable(fs.getFileStatus(file)))` would return `false`, resulting in the assertion error. The suggested fix to remove the hfile reference created during the test when the test exits. With the proposed fix, the test does not pollute the shared state (and passes when run twice in the same JVM). ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
