Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-25680

Non-idempotent test in TestReplicationHFileCleaner

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.5.0, 3.0.0-alpha-2, 2.4.6, 2.3.7
    • test
    • None
    • Reviewed

    Description

      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 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 return false, resulting in the assertion error.

       

      PR link: https://github.com/apache/hbase/pull/2984

      Attachments

        Issue Links

          Activity

            People

              lzx404243 Zhengxi Li
              lzx404243 Zhengxi Li
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: