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

Andreas Gudian commented on SUREFIRE-1098:
------------------------------------------

Tibor, could you take a look if the the suggested fix has an effect?

IIRC, the j.u.concurrent.ThreadPoolExecutor takes the next work item to process 
from the top of the queue, while newly submitted tasks land at the tail of the 
queue (which is the purpose of calling it a "queue"). So feeding the tests into 
the thread pool executor ordered by descending execution time (which I think is 
what "balanced" would try to do), should have the desired effect.

> runOrder=balanced is not working
> --------------------------------
>
>                 Key: SUREFIRE-1098
>                 URL: https://jira.codehaus.org/browse/SUREFIRE-1098
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Surefire Plugin
>    Affects Versions: 2.12.2, 2.12.3, 2.12.4, 2.13, 2.14, 2.14.1, 2.15, 2.16, 
> 2.17
>         Environment: JDK 7 on Linux
> JUnit 4.11
>            Reporter: Miyata Jumpei
>             Fix For: 2.18
>
>
> It seems that the runOrder parameter with balanced value is not working.
> 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>
>     <runOrder>balanced</runOrder>
>     <threadCount>2</threadCount>
>     <perCoreThreadCount>false</perCoreThreadCount>
>   </configuration>
> </plugin>
> {code}
> Then, execute the following tests.
> TestA: 1 second
> TestB: 2 seconds
> TestC: 3 seconds
> TestD: 4 seconds
> The expected order is the following from the second time.
> Thread 1: TestD &#8594; TestA
> Thread 2: TestC &#8594; TestB
> However, the actual order is the following.
> Thread 1: TestB &#8594; TestD
> Thread 2: TestC &#8594; TestA



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

Reply via email to