-
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-25680 Non-idempotent test in TestReplicationHFileCleaner #2984
HBASE-25680 Non-idempotent test in TestReplicationHFileCleaner #2984
Conversation
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
...server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestReplicationHFileCleaner.java
Outdated
Show resolved
Hide resolved
Is there a JIRA that goes w/ this PR? Thanks. |
@lzx404243 Please see above comments. Thanks. |
@saintstack I've created a jira issue for this: https://issues.apache.org/jira/browse/HBASE-25680 |
Thanks @lzx404243 I fixed the subject so it points to your new JIRA. Did you see @Apache9 's comment above? Thanks |
Thanks @saintstack for updating the subject. @Apache9 Please let me know what you think of my reply to your comment (See above). Thanks! |
Sorry, missed your previous reply. It will be good to remove all HFileRefs in tearDown. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
Thanks @Apache9 for the approval! Is there anything I can do before this can be merged? Thanks! |
Oh, sorry... Will merge soon. Thanks for the reminding~ |
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
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:The root cause is that the a hfile reference is added 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 returnfalse
, resulting in the assertion error.The suggested fix is 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).
Jira link: https://issues.apache.org/jira/browse/HBASE-25680