[ 
https://issues.apache.org/jira/browse/SUREFIRE-1918?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17358021#comment-17358021
 ] 

Martin Schneider commented on SUREFIRE-1918:
--------------------------------------------

The problem is exactly the same for the failsafe plugin: {{junit}} works, 
{{junit-vintage-engine}} doesn't.

> 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:
> {code:java}
> <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>{code}
>  
> Replacing the vintage engine with Junit 4 executes tests in parallel as 
> expected:
> {code:java}
> <dependency>
>   <groupId>junit</groupId>
>   <artifactId>junit</artifactId>
>   <version>4.13.2</version>
> </dependency>
> {code}
>  
> I have attached a minimal failing example. {{mvn test}} will produce the 
> following output:
> {code: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{code}
> The expected output (and what I get with JUnit 4) would be:
> {code: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{code}



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

Reply via email to