From 3a1b1d1d1e794999d513d8818301104f224ba77a Mon Sep 17 00:00:00 2001 From: Ben Liblit Date: Sat, 31 Mar 2018 18:15:40 -0500 Subject: [PATCH] Allow parallel testing within each subproject Without this setting, Gradle would run multiple "test" tasks from multiple subprojects concurrently, but each "test" task would only run a single test at a time. Some of our subprojects' test tasks take a long time to complete, which could easily leave us sequentially testing on just one or two CPU cores while other cores sit idle. With this change, Gradle will use as many task slots as are available (e.g., when run with "--parallel") to run multiple simultaneous JUnit test classes within any given subproject. This seems to be fine for us: I am unaware of any shared global state that would cause conflicts between two test classes within any given subproject. --- build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.gradle b/build.gradle index 966329bd2..92e31d96c 100644 --- a/build.gradle +++ b/build.gradle @@ -87,6 +87,8 @@ subprojects { subproject -> include '**/*Tests.class' include '**/Test*.class' exclude '**/*AndroidLibs*.class' + + maxParallelForks = Integer.MAX_VALUE } }