apache / apache/maven-surefire

Support runOrder=balanced with forkCount>1 (without parallel=classes)

Open
#3,396 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
461
Forks
588
Avg merge
1d 8h
Merged PRs (30d)
19

Description

Today `runOrder=balanced` looks only at `threadCount` (set by `parallel` or `-DthreadCount`) when it sorts the test classes. If you use `forkCount>1` but not `parallel=classes`, then `threadCount` is `1`. In that case `balanced` only puts the slowest classes first. It does not use the number of forks that run the tests.

I would like `balanced` to also use `forkCount`. The number of parallel test runners is `forkCount × threadCount`. So `balanced` should split the classes over that many runners. Then `balanced` also helps when you use `forkCount>1` without `parallel=classes`.

Idea for the code: send `forkCount` to the provider with a new `forkcount` property (the same way `threadcount` is sent today), and use `threadCount × forkCount` as the number of buckets in `DefaultRunOrderCalculator`.

Contributor guide

Open the contributing guide

Research direction

Trace how threadCount is sent to the provider, then inspect DefaultRunOrderCalculator and the existing balanced run-order calculation. Confirm how forkCount is represented and propagated; done means balanced scheduling uses threadCount × forkCount when forkCount is greater than one without parallel=classes, while existing behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.