Skip to content

Support for coordinating parallelism across a multi-project gradle test execution? #3076

Open
@danielstravito

Description

@danielstravito

Perhaps a feature request. The use case I have is that I have a large Kotlin project with over a hundred subprojects. Each subproject declares 1-30 test classes or so. To allow the CI and local development to run fast I want to saturate all cores at all times.

If I enable gradle's setting org.gradle.parallel=true it will spawn workers matching CPU core count (numCPU). This will result in for example 32 subproject's junit suites running at the same time. If the test task scheduler decides to put the subproject with the largest amount of test classes last, it will then utilize one single core at the end once the other parallel workers have finished off the rest of the subprojects. To workaround this, I could enable junit concurrency that would run test classes in parallel within each subproject. Problem with this is that I would overtax the CPU by having numCPU * numCPU concurrent test classes running at the same time.

So this brings me to the subject of this issue, is there any way of coordinating multiple gradle subproject junit executions in a way that at a maximum numCPU test classes are invoked across multiple workers (forked vm's) at any given time?

The gradle slack support channel suggested this would be a junit feature. With an ever growing number of cores in modern CPUs - even in laptops, this feature will be ever more relevant, no core deserves to be idle nor overtaxed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions