I'll have to check the code, but I'm pretty sure that the order of the test
classes to be handed over to the forked VMs is supposed to be what was is
specified with runOrder.

However, using -Dtest= might disable the ordering - but again, I'd have to
check the code.

Bit there's more: when having two classes to test and two forked VMs, there
is no real way to tell which test comes first. Both VMs are started right
away and only when the are up and running and ready to execute a test, they
ask the main process for one test class. Which VM will be the first to get
a class is quite random.

For the delayed reporting to console, try removing parallel=classes from
the config. IThe classes-setting has no effect when forking to more than
one fork anyway. If the output is still delayed then, create a bug-report,
please.


Am Donnerstag, 29. August 2013 schrieb Stevo Slavić :

> Hello Apache Maven community,
>
> To reproduce random failing test issue, I'm trying to run two tests in
> parallel, but start running them in specific order. Problem is that
> runOrder (added via SUREFIRE-614) doesn't seem to be respected, at least
> not when forkCount and/or test is specified as well.
>
> When trying to run two tests from Apache Mahout core module (trunk), I
> cannot get surefire to run them in reverse alphabetical order.
>
> Regardless if I run:
> mvn -Dtest=*KMeansTest -DrunOrder=reversealphabetical test
>
> or
> mvn -Dtest=*KMeansTest -DrunOrder=alphabetical test
>
> the two tests which match the pattern always get run in alphabetical order:
>
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running org.apache.mahout.clustering.streaming.cluster.BallKMeansTest
> Running org.apache.mahout.clustering.streaming.cluster.StreamingKMeansTest
> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 66.706 sec
> - in org.apache.mahout.clustering.streaming.cluster.BallKMeansTest
> Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 82.15 sec -
> in org.apache.mahout.clustering.streaming.cluster.StreamingKMeansTest
>
> Results :
>
> Tests run: 11, Failures: 0, Errors: 0, Skipped: 0
>
>
>
>
> Surefire 2.15 is used, and configuration is:
>
>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-surefire-plugin</artifactId>
>         <configuration>
>           <forkCount>1.5C</forkCount>
>           <reuseForks>false</reuseForks>
>           <threadCount>1</threadCount>
>           <perCoreThreadCount>false</perCoreThreadCount>
>           <parallel>classes</parallel>
>           <argLine>-Xmx512m</argLine>
>           <testFailureIgnore>false</testFailureIgnore>
>           <redirectTestOutputToFile>true</redirectTestOutputToFile>
>           <systemPropertyVariables>
>
> <mahout.test.directory>${project.build.directory}</mahout.test.directory>
>           </systemPropertyVariables>
>         </configuration>
>       </plugin>
>
>
> When I use latest surefire 2.16, outcome is even more odd - output that any
> of the tests is running takes longer to render, it seems to be rendered
> together with info that test has completed, so by looking at build log
> output it may appear as if tests were not running in parallel even though
> they did:
>
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running org.apache.mahout.clustering.streaming.cluster.BallKMeansTest
> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 59.347 sec
> - in org.apache.mahout.clustering.streaming.cluster.BallKMeansTest
> Running org.apache.mahout.clustering.streaming.cluster.StreamingKMeansTest
> Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 74.766 sec
> - in org.apache.mahout.clustering.streaming.cluster.StreamingKMeansTest
>
> Results :
>
> Tests run: 11, Failures: 0, Errors: 0, Skipped: 0
>
>
> Here is my "mvn --version" output:
>
> [sslavic@laptop core]$ mvn --version
> Apache Maven 3.1.0 (893ca28a1da9d5f51ac03827af98bb730128f9f2; 2013-06-28
> 04:15:32+0200)
> Maven home: /home/sslavic/work/tools/apache-maven
> Java version: 1.7.0_25, vendor: Oracle Corporation
> Java home: /usr/java/jdk1.7.0_25/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "3.10.9-200.fc19.x86_64", arch: "amd64", family:
> "unix"
>
>
>
> Am I doing something wrong or is this behavior bug (or two bugs) in
> surefire?
>
> Kind regards,
> Stevo Slavic.
>

Reply via email to