Browse Source

Run unit tests in parallel

Configure Maven surefire plugin to run tests concurrently using
multiple processes. By default use one process per core available
on the machine running the tests.

Running this on my MacBook Pro i7 with 8 cores 16 GB RAM SSD
I get the following results:

forkCount   "mvn clean install" on org.eclipse.jgit.test
--------------------------------------------------------
1           02:36 min
2           01:26 min
4           00:56 min
6           00:49 min
8           00:49 min
10          00:51 min

When on-access scan of McAfee virus scanner is enabled the optimum
is at half the number of cores (4 of 8) on my MacBook.

Set system property "test-fork-count" to override the default.
Either set it to an absolute number e.g. "4" or in units of
cores available on the system running the build. E.g. "0.5C" to
use 4 cores on a 8 core system or "1C" to use all 8 cores on
a 8 core system.
E.g.
$ mvn clean install -Dtest-fork-count=0.5C
to use half the number of cores processes to run tests.

Change-Id: Ifdbd1ae8153f2033922eae6ae8942c36db1f9806
Signed-off-by: Sohn <matthias.sohn@sap.com>
tags/v3.5.0.201409071800-rc1
Matthias Sohn 9 years ago
parent
commit
d846610035
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      pom.xml

+ 5
- 0
pom.xml View File

@@ -179,6 +179,7 @@
<jsch-version>0.1.50</jsch-version>
<javaewah-version>0.7.9</javaewah-version>
<junit-version>4.11</junit-version>
<test-fork-count>1C</test-fork-count>
<!-- TODO: update Maven dependency for args4j to 2.0.21 as soon as available on Maven Central -->
<args4j-version>2.0.12</args4j-version>
<commons-compress-version>1.6</commons-compress-version>
@@ -276,6 +277,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<forkCount>${test-fork-count}</forkCount>
<reuseForks>true</reuseForks>
</configuration>
</plugin>

<plugin>

Loading…
Cancel
Save