-
Notifications
You must be signed in to change notification settings - Fork 71
Enable parallel forks for tests #760
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
Conversation
That is a good idea! |
@@ -374,6 +375,10 @@ tasks.test { | |||
} | |||
} | |||
|
|||
tasks.getByName<Test>("samplesTest") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this referred to all of our tests?
@@ -364,6 +364,7 @@ tasks.withType<KotlinCompile> { | |||
|
|||
tasks.test { | |||
maxHeapSize = "2048m" | |||
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's worth to know, how many processors/cores are available in average on TC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imagine that we have 4 cores, could take only 2 of them, not all parts are parallelized: @BeforeTest leads to the max.parallelization < 2 and plus overhead of running in different threads. From the other hand it's doing nothing bad, let's play
I also saw, that it worth to set up env variables
systemProperties["junit.jupiter.execution.parallel.enabled"] = true
systemProperties["junit.jupiter.execution.parallel.mode.default"] = "concurrent"
but also a lot of threads that with these settings JUnit don't want to run tests in parallel
https://stackoverflow.com/questions/74599354/junit-not-running-tests-in-parallel
Probably we need to log/println on that core it was executed
I converted the PR to a draft for now since we didn't get the results we wanted (yet). Feel free to change it if it improves :) |
Let's see how it affects build server performance. I tried to benchmark locally, but execution time is just way too unstable to tell if it actually helps or not
Configured according to https://docs.gradle.org/current/userguide/performance.html#execute_tests_in_parallel