Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.22.2, 3.0.0-M5
-
None
-
None
-
Apache Maven 3.8.1
Description
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