Skip to content

Commit

Permalink
Tweak maxParallelForks
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Jun 21, 2024
1 parent cf6f5db commit 8969647
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@ val isCiBuild = providers.environmentVariable("CI").isPresent
tasks.withType<Test>().configureEach {
useJUnitPlatform()

maxParallelForks = if (isCiBuild) {
Runtime.getRuntime().availableProcessors()
} else {
// https://docs.gradle.org/8.0/userguide/performance.html#execute_tests_in_parallel
(Runtime.getRuntime().availableProcessors() / 2).takeIf { it > 0 } ?: 1
}
// https://docs.gradle.org/8.8/userguide/performance.html#execute_tests_in_parallel
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
}

tasks.test {
Expand Down

0 comments on commit 8969647

Please sign in to comment.