[Issue-3396] Support runOrder=balanced with forkCount>1#3397
Open
joshiste wants to merge 1 commit into
Open
Conversation
Balanced run order sized its class distribution only by the parallel threadCount, so with forkCount>1 and no parallel=classes it degraded to a plain slowest-first list and ignored the number of forks consuming tests. Size the distribution by the real concurrency, forkCount * threadCount, by propagating forkCount to the provider via a new forkcount provider property (mirroring threadcount) and using the product as the bin-packing width. The calculator field is renamed to distributedParallelism to reflect the wider meaning. This makes balanced effective with forkCount>1 even without parallel=classes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3396
What
runOrder=balancedused onlythreadCountto sort the test classes. WithforkCount>1and noparallel=classes,threadCountis1. Sobalancedonly put the slowest classes first and did not use the number of forks.This change makes
balanceduseforkCount × threadCountas the number of parallel test runners. Nowbalancedalso helps when you useforkCount>1withoutparallel=classes.How
forkcountprovider property (ProviderParameterNames.FORKCOUNT_PROP). The mojo sends it to the provider, the same way as the existingthreadcount.BaseProviderFactory.getRunOrderCalculator()now usesthreadCount × forkCount.getForkCount()uses the same default and clamp asgetThreadCount().threadCounttodistributedParallelisminDefaultRunOrderCalculator, because it now means threads and forks together.SurefireMojoandIntegrationTestMojo. Removed the old note that said "only relevant with parallel=classes".Tests
BaseProviderFactoryTest: checks the width isthreadCount × forkCount, plus the default and the clamp cases.RunOrderIT(andRunOrderParallelForksIT): runbalancedwithforkCount>1(both reuse modes) and withforkCount=0.mvn clean installon the changed modules. Basic checks pass.RunOrderIT,RunOrderParallelForksIT) with-Prun-its. They pass.