From cd11aeceac3ba33efd84244cbca5a2c35af18bc3 Mon Sep 17 00:00:00 2001 From: Dmitriy Dolovov Date: Thu, 16 Dec 2021 18:37:35 +0300 Subject: [PATCH] [Native][tests] Disable JVM C2 compiler at host machines with >4 CPU cores --- native/native.tests/build.gradle.kts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/native/native.tests/build.gradle.kts b/native/native.tests/build.gradle.kts index ec7c50e68b4..af7da129a70 100644 --- a/native/native.tests/build.gradle.kts +++ b/native/native.tests/build.gradle.kts @@ -81,6 +81,13 @@ fun blackBoxTest(taskName: String, vararg tags: String) = projectTest(taskName, // additional stack frames more compared to the old one because of another launcher, etc. and it turns out this is not enough. jvmArgs("-Xss2m") + if (!kotlinBuildProperties.isTeamcityBuild + && minOf(kotlinBuildProperties.junit5NumberOfThreadsForParallelExecution ?: 16, Runtime.getRuntime().availableProcessors()) > 4 + ) { + logger.info("JVM C2 compiler has been disabled for task $path") + jvmArgs("-XX:TieredStopAtLevel=1") // Disable C2 if there are more than 4 CPUs at the host machine. + } + TestProperty.KOTLIN_NATIVE_HOME.setUpFromGradleProperty(this) { project(":kotlin-native").projectDir.resolve("dist").absolutePath }