maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stevo Slavić <ssla...@gmail.com>
Subject [surefire] Combining test, runOrder and forkCount
Date Thu, 29 Aug 2013 10:52:57 GMT
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.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message