[ 
https://jira.codehaus.org/browse/SUREFIRE-1103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=353536#comment-353536
 ] 

Tibor Digana commented on SUREFIRE-1103:
----------------------------------------

ok, but the "Test" is in reality a suite.
If you have 4xTest, where each of them has only one nested "InnerTest", then 
you should use <parallel>suites</parallel> (since of 2.16).

This is a little misunderstanding between suites and classes.
In 2.15 you had classes and methods in the configuration, but in reality it 
meant parent and child.
This means that parallel=classes is running suites instead of real TestCase as 
a class.
On the other side more worse, parallel=methods run a child of Suite which is 
obviously TestCase class and not the methods of every individual TestCase class.

Since of 2.16, this was fixed with real meaning, and you have to more precisely 
say what you want to run in parallel:

suites
classes
methods
suitesAndClasses
suitesAndMethods
classesAndMethods

Similar with threadCount, can be any of or combination of:

threadCount
threadCountSuites
threadCountClasses
threadCountMethods

Read the spec 
http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html

> The total amount of threads are not used with test classes nested by 
> Enclosed.class.
> ------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-1103
>                 URL: https://jira.codehaus.org/browse/SUREFIRE-1103
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.7+ (parallel) support
>    Affects Versions: 2.16, 2.17
>         Environment: JDK 7 on Linux 
> JUnit 4.11
>            Reporter: Miyata Jumpei
>
> It seems that the total amount of threads are not used with test classes 
> nested by Enclosed.class.
> For example, I created a project with the following setting.
> {code}
> <plugin>
>   <artifactId>maven-surefire-plugin</artifactId>
>   <version>2.17</version>
>   <configuration>
>     <parallel>classes</parallel>
>     <threadCount>4</threadCount>
>     <perCoreThreadCount>false</perCoreThreadCount>
>   </configuration>
> </plugin>
> {code}
> And, create 4 test classes like the following.
> {code}
> @RunWith(Enclosed.class)
> public class Test {
>     public static class InnerTest {
>         @Test
>         public void test1() throws InterruptedException {
>             Thread.sleep(1000l);
>         }
>     }
> }
> {code}
> It takes 4 seconds to execute the 4 tests.
> With 2.15, it takes only 1 second.
> It seems that the outer tests are not parallelly-processed until all inner 
> tests are processed.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to