Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 19888

Parallel tests in subprojects

$
0
0

Gradle (we’re on 5.6.2) is set up with parallel execution through gradle.properties, and max workers defaults to # processors as I understand. You don’t activate concurrency through @Execution, or either properties file or system properties? My tests don’t seem to run in parallel unless I do something like this

tasks.test{
     // this runs in parallel
     useJunitPlatform()
     systemProperties['junit.jupiter.execution.parallel.enabled'] = true
     systemProperties['junit.jupiter.execution.parallel.mode.default'] = 'concurrent'
     systemProperties['junit.jupiter.execution.parallel.mode.default.classes'] = 'concurrent'
}

Config below runs test sequentially

tasks.test{
     useJunitPlatform()
     maxParallelForks = 24
}

Config below runs test in parallel even with maxParallelForks = 1

tasks.test{
     useJunitPlatform()
     systemProperties['junit.jupiter.execution.parallel.enabled'] = true
     systemProperties['junit.jupiter.execution.parallel.mode.default'] = 'concurrent'
     systemProperties['junit.jupiter.execution.parallel.mode.default.classes'] = 'concurrent'
     maxParallelForks = 1
}

Viewing all articles
Browse latest Browse all 19888

Trending Articles