Skip to content

Commit eab819e

Browse files
NotStirredCursedFlames
authored andcommitted
Enable parallelism in tests using jvm forks
1 parent e88adff commit eab819e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,12 @@ tasks.register('unzipTests', Copy) {
301301
into(sourceSets.test.output.classesDirs.asPath)
302302
}
303303

304+
tasks.withType(Test).configureEach {
305+
// gradle docs suggest processors/2 which actually runs fractionally faster than just processors
306+
// forking a jvm is expensive.
307+
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
308+
}
309+
304310
test {
305311
minHeapSize = "512M"
306312
maxHeapSize = "2048M"
@@ -325,6 +331,7 @@ test {
325331
def longRunTest = tasks.register("longRunTest", Test) {
326332
minHeapSize = "512M"
327333
maxHeapSize = "2048M"
334+
systemProperty("junit.jupiter.testclass.order.default", "org.junit.jupiter.api.ClassOrderer.OrderAnnotation")
328335

329336
useJUnitPlatform {
330337
includeTags "longRunTest"

0 commit comments

Comments
 (0)