[Native][tests] Log JUnit5 parallel test execution parameters in Gradle build
This commit is contained in:
@@ -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.
|
// additional stack frames more compared to the old one because of another launcher, etc. and it turns out this is not enough.
|
||||||
jvmArgs("-Xss2m")
|
jvmArgs("-Xss2m")
|
||||||
|
|
||||||
|
val availableCpuCores: Int = Runtime.getRuntime().availableProcessors()
|
||||||
if (!kotlinBuildProperties.isTeamcityBuild
|
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.
|
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 {
|
useJUnitPlatform {
|
||||||
includeTags(*tags)
|
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
|
} else
|
||||||
doFirst {
|
doFirst {
|
||||||
throw GradleException(
|
throw GradleException(
|
||||||
|
|||||||
Reference in New Issue
Block a user