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

HBaseClassTestRule: system exit not restored if test times out may cause test to hang

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.6.0, 3.0.0-alpha-4, 2.5.5, 2.4.18
    • test
    • None
    • maven unit tests

    • Reviewed

    Description

      HBaseClassTestRule applies a timeout and a system exit rule to tests. The timeout rule throws an exception if it hits the timeout threshold. Since the timeout rule is applied after the system exit rule, the system exit rule does not see the exception and does not re-enable the default system exit behavior which can cause maven to hang on some tests. I saw the hang happen when certain tests timed out on s390x but it could happen on any platform.
       
      If the org.apache.hadoop.hbase.TestTimeout.infiniteLoop test is enabled and run it will generate a *-jvmRun1.dump file which shows that the org.apache.hadoop.hbase.TestSecurityManager is still enabled:
       

      1. Created at 2023-04-27T15:51:58.947
        org.apache.hadoop.hbase.SystemExitRule$SystemExitInTestException
                at org.apache.hadoop.hbase.TestSecurityManager.checkExit(TestSecurityManager.java:32)
                at java.base/java.lang.Runtime.exit(Runtime.java:114)
                at java.base/java.lang.System.exit(System.java:1752)
                at org.apache.maven.surefire.booter.ForkedBooter.acknowledgedExit(ForkedBooter.java:381)
                at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:178)
                at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)
                at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)
        ...

       

      Attachments

        Issue Links

          Activity

            People

              jonathan.albrecht Jonathan Albrecht
              jonathan.albrecht Jonathan Albrecht
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: