apache / apache/maven-surefire
[SUREFIRE-1918] Parallel execution doesn't work with junit-vintage-engine
- Dominant language
- Java
- Stars
- 461
- Forks
- 588
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 19
Description
**[Martin Schneider](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=martinschneider)** opened **[SUREFIRE-1918](https://issues.apache.org/jira/browse/SUREFIRE-1918?redirect=false)** and commented
Tests don't get executed in parallel with JUnit's vintage engine.
The following configuration executes them serially:
```java
org.junit.vintage
junit-vintage-engine
5.7.2
...
org.apache.maven.plugins
maven-surefire-plugin
3.0.0-M5
methods
true
```
Replacing the vintage engine with Junit 4 executes tests in parallel as expected:
```java
junit
junit
4.13.2
```
I have attached a minimal failing example. `mvn test` will produce the following output:
```java
[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:
```java
[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
```
---
**Affects:** 2.22.2, 3.0.0-M5
**Attachments:**
- [parallel-tests.tar.gz](https://issues.apache.org/jira/secure/attachment/13026447/parallel-tests.tar.gz) (_1015 bytes_)
Contributor guide
Research direction
Start by unpacking parallel-tests.tar.gz and running mvn test with junit-vintage-engine and the shown maven-surefire-plugin configuration. Compare the execution threads with the JUnit 4 variant, then trace how parallel execution is handled for the vintage engine. Done means the vintage configuration runs tests in parallel as shown by the expected output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100