[Native][tests] Log JUnit5 parallel test execution parameters in Gradle build

This commit is contained in:
Dmitriy Dolovov
2021-12-17 12:20:14 +03:00
parent cd11aeceac
commit c3a422105d
+13 -2
View File
@@ -81,10 +81,11 @@ 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")
val availableCpuCores: Int = Runtime.getRuntime().availableProcessors()
if (!kotlinBuildProperties.isTeamcityBuild
&& minOf(kotlinBuildProperties.junit5NumberOfThreadsForParallelExecution ?: 16, Runtime.getRuntime().availableProcessors()) > 4
&& minOf(kotlinBuildProperties.junit5NumberOfThreadsForParallelExecution ?: 16, availableCpuCores) > 4
) {
logger.info("JVM C2 compiler has been disabled for task $path")
logger.info("$path JIT C2 compiler has been disabled")
jvmArgs("-XX:TieredStopAtLevel=1") // Disable C2 if there are more than 4 CPUs at the host machine.
}
@@ -106,6 +107,16 @@ fun blackBoxTest(taskName: String, vararg tags: String) = projectTest(taskName,
useJUnitPlatform {
includeTags(*tags)
}
logger.info(
buildString {
appendLine("$path parallel test execution parameters:")
append(" Available CPU cores = $availableCpuCores")
systemProperties.filterKeys { it.startsWith("junit.jupiter") }.toSortedMap().forEach { (key, value) ->
append("\n $key = $value")
}
}
)
} else
doFirst {
throw GradleException(