Skip to content

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Enable parallel forks for tests #760

wants to merge 1 commit into from

Conversation

koperagen
Copy link
Collaborator

@koperagen koperagen commented Jun 27, 2024

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

@Jolanrensen
Copy link
Collaborator

That is a good idea!

@@ -374,6 +375,10 @@ tasks.test {
}
}

tasks.getByName<Test>("samplesTest") {
Copy link
Collaborator

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)
Copy link
Collaborator

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

Copy link
Collaborator

@zaleslaw zaleslaw left a 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

@Jolanrensen Jolanrensen marked this pull request as draft July 23, 2024 12:19
@Jolanrensen
Copy link
Collaborator

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 :)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants