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

surefire 2.22.0 does not work with forkCount > 0 and junit 5.3.x

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Resolved
    • Affects Version/s: 2.22.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      MacOS X, Maven 3.5.4, Java 8_181
    • Flags:
      Important

      Description

      • clone the junit test examples from git@github.com:junit-team/junit5-samples.git
      • go to the junit5-samples/junit5-jupiter-starter-maven folder
      • checkout the 5.2.0 version:   git checkout -b 5.2.0 origin/r5.2.0
      • edit the pom file to read:

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.0</version>
        <configuration>
          <forkCount>1</forkCount>
        </configuration>
      </plugin>

      • Run 'mvn clean test' -> The tests are run
      • change the forkCount to 2., run 'mvn clean test' again. -> The tests are run

      => junit 5.2.0 works with surefire 2.22.0

      • Now checkout the 5.3.0 version (or 5.3.1 version): git checkout -b 5.3.0 origin/r5.3.0
      • Make the same change to the pom, use forkCount value 1
      • Run 'mvn clean test' -> The tests are run
      • Use forkCount value 2, run 'mvn clean test' -> The tests are not run.

      -> junit 5.3.x does not work with surefire 2.22.0

      Capturing full mvn -X output yields only a single difference in the logs:

       

      [DEBUG] Determined Maven Process ID 66290
      [DEBUG] boot classpath: /Users/hschmiedehausen/.m2/repository/org/apache/maven/surefire/surefire-booter/2.22.0/surefire-booter-2.22.0.jar /Users/hschmiedehausen/.m2/repository/org/apache/maven/surefire/surefire-api/2.22.0/surefire-api-2.22.0.jar /Users/hschmiedehausen/.m2/repository/org/apache/maven/surefire/surefire-logger-api/2.22.0/surefire-logger-api-2.22.0.jar /Users/hschmiedehausen/scratch/junit5-samples/junit5-jupiter-starter-maven/target/test-classes /Users/hschmiedehausen/scratch/junit5-samples/junit5-jupiter-starter-maven/target/classes /Users/hschmiedehausen/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.3.1/junit-jupiter-api-5.3.1.jar /Users/hschmiedehausen/.m2/repository/org/apiguardian/apiguardian-api/1.0.0/apiguardian-api-1.0.0.jar /Users/hschmiedehausen/.m2/repository/org/opentest4j/opentest4j/1.1.1/opentest4j-1.1.1.jar /Users/hschmiedehausen/.m2/repository/org/junit/platform/junit-platform-commons/1.3.1/junit-platform-commons-1.3.1.jar /Users/hschmiedehausen/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.3.1/junit-jupiter-params-5.3.1.jar /Users/hschmiedehausen/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.3.1/junit-jupiter-engine-5.3.1.jar /Users/hschmiedehausen/.m2/repository/org/junit/platform/junit-platform-engine/1.3.1/junit-platform-engine-1.3.1.jar /Users/hschmiedehausen/.m2/repository/org/apache/maven/surefire/surefire-junit-platform/2.22.0/surefire-junit-platform-2.22.0.jar /Users/hschmiedehausen/.m2/repository/org/junit/platform/junit-platform-launcher/1.2.0/junit-platform-launcher-1.2.0.jar /Users/hschmiedehausen/.m2/repository/org/junit/platform/junit-platform-engine/1.2.0/junit-platform-engine-1.2.0.jar /Users/hschmiedehausen/.m2/repository/org/junit/platform/junit-platform-commons/1.2.0/junit-platform-commons-1.2.0.jar /Users/hschmiedehausen/.m2/repository/org/opentest4j/opentest4j/1.1.0/opentest4j-1.1.0.jar
      [DEBUG] boot(compact) classpath: surefire-booter-2.22.0.jar surefire-api-2.22.0.jar surefire-logger-api-2.22.0.jar test-classes classes junit-jupiter-api-5.3.1.jar apiguardian-api-1.0.0.jar opentest4j-1.1.1.jar junit-platform-commons-1.3.1.jar junit-jupiter-params-5.3.1.jar junit-jupiter-engine-5.3.1.jar junit-platform-engine-1.3.1.jar surefire-junit-platform-2.22.0.jar junit-platform-launcher-1.2.0.jar junit-platform-engine-1.2.0.jar junit-platform-commons-1.2.0.jar opentest4j-1.1.0.jar
      [DEBUG] Forking command line: /bin/sh -c cd /Users/hschmiedehausen/scratch/junit5-samples/junit5-jupiter-starter-maven && /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/jre/bin/java -Xmx256m -Dfile.encoding=UTF-8 org.apache.maven.surefire.booter.ForkedBooter /Users/hschmiedehausen/scratch/junit5-samples/junit5-jupiter-starter-maven/target/surefire 2018-10-08T17-22-03_800-jvmRun1 surefire682835141025762671tmp surefire_08147820383697829015tmp
      [INFO] Running com.example.project.CalculatorTests
      [INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.082 s - in com.example.project.CalculatorTests
      [INFO]
      [INFO] Results:
      [INFO]
      [INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0

      for a working (forkCount value = 1) vs.

      [INFO]
      [INFO] Results:
      [INFO]
      [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
      {{[INFO] }}

      for a non-working (forkValue = 1.0C)

       

        Attachments

          Activity

            People

            • Assignee:
              tibordigana Tibor Digana
              Reporter:
              hgschmie Henning Schmiedehausen
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: