Skip to content

Commit 18d1c7f

Browse files
committed
Address review comments
1 parent 24f7522 commit 18d1c7f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

dd-smoke-tests/log-injection/build.gradle

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,10 @@ generateTestingJar('Flogger', 'Slf4jToLogbackLatest',
353353
tasks.withType(Test).configureEach {
354354
dependsOn tasks.withType(ShadowJar)
355355

356-
if (System.getenv("RUNTIME_AVAILABLE_PROCESSORS_OVERRIDE") != null) {
357-
maxParallelForks = Integer.valueOf(System.getenv("RUNTIME_AVAILABLE_PROCESSORS_OVERRIDE"))
358-
} else {
359-
maxParallelForks = Math.max(1, (Runtime.getRuntime().availableProcessors() / 2) as int)
360-
}
356+
// Runtime.getRuntime().availableProcessors() is used to scale the parallelism by default,
357+
// but it returns weird values in Gitlab/kubernetes, so fix to a specific value when available
358+
def override = System.getenv("RUNTIME_AVAILABLE_PROCESSORS_OVERRIDE")
359+
maxParallelForks = override?.toInteger() ?: Math.max(1, (Runtime.runtime.availableProcessors() / 2).toInteger())
361360
}
362361

363362

0 commit comments

Comments
 (0)