Build: Apply ConcurrencyLimitService to all tests tasks in the project
Some project tasks are not created with projectTest helper, but all tasks should be limited since we can't use `--no-parallel` on CI
This commit is contained in:
+8
@@ -274,8 +274,16 @@ fun Project.configureTests() {
|
||||
}
|
||||
}
|
||||
|
||||
val concurrencyLimitService = project.gradle.sharedServices.registerIfAbsent(
|
||||
"concurrencyLimitService",
|
||||
ConcurrencyLimitService::class
|
||||
) {
|
||||
maxParallelUsages = 1
|
||||
}
|
||||
|
||||
tasks.withType<Test>().configureEach {
|
||||
outputs.doNotCacheIf("https://youtrack.jetbrains.com/issue/KTI-112") { true }
|
||||
usesService(concurrencyLimitService)
|
||||
}
|
||||
|
||||
// Aggregate task for build related checks
|
||||
|
||||
@@ -138,10 +138,6 @@ fun Project.projectTest(
|
||||
defineJDKEnvVariables: List<JdkMajorVersion> = emptyList(),
|
||||
body: Test.() -> Unit = {},
|
||||
): TaskProvider<Test> {
|
||||
val concurrencyLimitService =
|
||||
project.gradle.sharedServices.registerIfAbsent("concurrencyLimitService", ConcurrencyLimitService::class) {
|
||||
maxParallelUsages = 1
|
||||
}
|
||||
val shouldInstrument = project.providers.gradleProperty("kotlin.test.instrumentation.disable")
|
||||
.orNull?.toBoolean() != true
|
||||
if (shouldInstrument) {
|
||||
@@ -225,7 +221,6 @@ fun Project.projectTest(
|
||||
defaultMaxMemoryPerTestWorkerMb
|
||||
|
||||
maxHeapSize = "${maxHeapSizeMb ?: (memoryPerTestProcessMb - maxMetaspaceSizeMb - reservedCodeCacheSizeMb)}m"
|
||||
usesService(concurrencyLimitService)
|
||||
|
||||
if (minHeapSizeMb != null) {
|
||||
minHeapSize = "${minHeapSizeMb}m"
|
||||
|
||||
Reference in New Issue
Block a user