Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-10106

Fix thread leaks in JUnit modules

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    ISPN-9863 added a thread leak checker, but even with all the recent improvements, leaks in JUnit modules are not reported as test failures.

    Because Surefire ignores failures in JUnit configuration methods and listeners, the only sign of a leak is an error message in the console output:

    [2019-03-28T17:33:54.119Z] org.apache.maven.surefire.booter.SurefireBooterForkException: ExecutionException There was an error in the forked process
    [2019-03-28T17:33:54.119Z] Test mechanism :: Leaked threads: 
    [2019-03-28T17:33:54.119Z]   {pool-7-thread-1: possible sources [UNKNOWN]},
    [2019-03-28T17:33:54.119Z]   {management-client-thread 1-1: possible sources [UNKNOWN]}
    

    And in a dump file:

    [2019-03-28T18:23:39.501Z] ./integrationtests/security-it/target/failsafe-reports/2019-03-28T17-28-10_213-jvmRun1.dump
    [2019-03-28T18:23:39.501Z] # Created at 2019-03-28T17:29:25.623
    [2019-03-28T18:23:39.501Z] org.apache.maven.surefire.testset.TestSetFailedException: Test mechanism :: Leaked threads: 
    [2019-03-28T18:23:39.501Z]   {pool-7-thread-1: possible sources [UNKNOWN]},
    [2019-03-28T18:23:39.501Z]   {management-client-thread 1-1: possible sources [UNKNOWN]}
    [2019-03-28T18:23:39.501Z] 	at org.apache.maven.surefire.common.junit4.JUnit4RunListener.rethrowAnyTestMechanismFailures(JUnit4RunListener.java:223)
    

            dberinde@redhat.com Dan Berindei (Inactive)
            dberinde@redhat.com Dan Berindei (Inactive)
            Archiver:
            rhn-support-adongare Amol Dongare

              Created:
              Updated:
              Resolved:
              Archived: