Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1055

Parallel JUnit does not run all test methods with parallel=classesAndMethods perCoreThreadCount=false useUnlimitedThreads=true and threadCountMethods specified

    XMLWordPrintableJSON

Details

    Description

      Some test methods are skipped at random with the below configuration. When test methods are skipped in this way, only one method in the class runs. Running tests repeatedly with no code change often yields a different number of tests with each run (e.g. see the attached surefire-output.txt). Tests that take longer to run are less likely to be affected. This affects version 2.16 of Surefire and Failsafe equally.

      Here is a simple test project which reproduces the issue: https://github.com/hansenc/SUREFIRE-1055
      It has a few simple test classes with a naming convention for how many test methods are in each class (e.g. Methods4Test has 4 test methods).

      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.16</version>
          <configuration>
              <parallel>classesAndMethods</parallel>
              <perCoreThreadCount>false</perCoreThreadCount>
              <useUnlimitedThreads>true</useUnlimitedThreads>
              <threadCountMethods>3</threadCountMethods>
          </configuration>
      </plugin>
      

      Attachments

        1. surefire-output.txt
          9 kB
          Chris Hansen

        Activity

          People

            krosenvold Kristian Rosenvold
            chris.hansen Chris Hansen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: