[
https://issues.apache.org/jira/browse/SUREFIRE-1918?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Martin Schneider updated SUREFIRE-1918:
---------------------------------------
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}}
was:
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}}
> 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: 2.22.2, 3.0.0-M5
> Environment: Apache Maven 3.8.1
> Reporter: Martin Schneider
> Priority: Major
> 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)