You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Martin Schneider (Jira)" <ji...@apache.org> on 2021/06/06 04:57:00 UTC

[jira] [Created] (SUREFIRE-1918) Parallel execution doesn't work with junit-vintage-engine

Martin Schneider created SUREFIRE-1918:
------------------------------------------

             Summary: Parallel execution doesn't work with junit-vintage-engine
                 Key: SUREFIRE-1918
                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1918
             Project: Maven Surefire
          Issue Type: Bug
          Components: Junit 4.7+ (parallel) support
    Affects Versions: 3.0.0-M5, 2.22.2
         Environment: Apache Maven 3.8.1
            Reporter: Martin Schneider
         Attachments: parallel-tests.tar.gz

Tests don't get executed in parallel with JUnit's vintage engine.

The following configuration executes them serially:

{{<dependency>}}
{{   <groupId>org.junit.vintage</groupId>}}
{{   <artifactId>junit-vintage-engine</artifactId>}}
{{   <version>5.7.2</version>}}
{{</dependency>}}
{{}}{{}}

{{...}}

{{<plugin>}}
{{  <groupId>org.apache.maven.plugins</groupId>}}
{{   <artifactId>maven-surefire-plugin</artifactId>}}
{{   <version>3.0.0-M5</version>}}
{{   <configuration>}}
{{     <parallel>methods</parallel>}}
{{     <useUnlimitedThreads>true</useUnlimitedThreads>}}
{{   </configuration>}}
{{ </plugin>}}

Replacing the vintage engine with Junit 4 executes tests in parallel as expected:

{{<dependency>}}
{{   <groupId>junit</groupId>}}
{{   <artifactId>junit</artifactId>}}
{{   <version>4.13.2</version>}}
{{</dependency>}}

I have attached a minimal failing example. `mvn test` will produce the following output:

{{[INFO] -------------------------------------------------------}}
{{[INFO] T E S T S}}
{{[INFO] -------------------------------------------------------}}
{{[INFO] Running ParallelTest}}
{{Test 1 running in main}}
{{Test 2 running in main}}
{{Test 3 running in main}}
{{Test 4 running in main}}

The expected output (and what I get with JUnit 4) would be:

{{[INFO] -------------------------------------------------------}}
{{[INFO] T E S T S}}
{{[INFO] -------------------------------------------------------}}
{{[INFO] Running ParallelTest}}
{{Test 1 running in pool-2-thread-1}}
{{Test 3 running in pool-2-thread-3}}
{{Test 4 running in pool-2-thread-4}}
{{Test 2 running in pool-2-thread-2}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)