From d84661003526167ad474c264a87360d567defda9 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Mon, 4 Aug 2014 01:04:26 +0200 Subject: [PATCH] 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 --- pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pom.xml b/pom.xml index b38db15beb..a26e9ffa16 100644 --- a/pom.xml +++ b/pom.xml @@ -179,6 +179,7 @@ 0.1.50 0.7.9 4.11 + 1C 2.0.12 1.6 @@ -276,6 +277,10 @@ org.apache.maven.plugins maven-surefire-plugin 2.16 + + ${test-fork-count} + true + -- 2.39.5