diff --git a/buildSrc/src/main/kotlin/BuildPropertiesExt.kt b/buildSrc/src/main/kotlin/BuildPropertiesExt.kt index 2b01333a588..213d97dda95 100644 --- a/buildSrc/src/main/kotlin/BuildPropertiesExt.kt +++ b/buildSrc/src/main/kotlin/BuildPropertiesExt.kt @@ -35,4 +35,7 @@ val KotlinBuildProperties.isObsoleteJdkOverrideEnabled: Boolean get() = getBoolean("kotlin.build.isObsoleteJdkOverrideEnabled", false) val KotlinBuildProperties.isNativeRuntimeDebugInfoEnabled: Boolean - get() = getBoolean("kotlin.native.isNativeRuntimeDebugInfoEnabled", false) \ No newline at end of file + get() = getBoolean("kotlin.native.isNativeRuntimeDebugInfoEnabled", false) + +val KotlinBuildProperties.junit5NumberOfThreadsForParallelExecution: Int? + get() = (getOrNull("kotlin.test.junit5.maxParallelForks") as? String)?.toInt() diff --git a/buildSrc/src/main/kotlin/tasks.kt b/buildSrc/src/main/kotlin/tasks.kt index a483ee59cda..35b492212d0 100644 --- a/buildSrc/src/main/kotlin/tasks.kt +++ b/buildSrc/src/main/kotlin/tasks.kt @@ -199,6 +199,10 @@ fun Project.projectTest( systemProperty("jps.kotlin.home", project.rootProject.extra["distKotlinHomeDir"]!!) systemProperty("kotlin.ni", if (project.rootProject.hasProperty("newInferenceTests")) "true" else "false") systemProperty("org.jetbrains.kotlin.skip.muted.tests", if (project.rootProject.hasProperty("skipMutedTests")) "true" else "false") + project.kotlinBuildProperties.junit5NumberOfThreadsForParallelExecution?.let { n -> + systemProperty("junit.jupiter.execution.parallel.config.strategy", "fixed") + systemProperty("junit.jupiter.execution.parallel.config.fixed.parallelism", n) + } systemProperty("idea.ignore.disabled.plugins", "true") @@ -319,4 +323,4 @@ abstract class PublishToMavenLocalSerializable : AbstractPublishToMaven() { } }.run() } -} \ No newline at end of file +} diff --git a/gradle.properties b/gradle.properties index e5f9b139d8b..658c75430d0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -67,6 +67,9 @@ org.gradle.vfs.watch=true # If it differs from default use next flag: #bootstrap.local.path=/path/to/repo +# Set number of threads which are used for running JUnit 5 tests in concurrent mode +# If not set then min(number of CPU cores, 16) will be used +#kotlin.test.junit5.maxParallelForks=4 # Those properties are used to automatically generate run configurations for modularized # and full pipeline tests for different sets of test data