Add option to balance jobs by example instead of by file #105
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.
Hi,
I'm opening this PR to start a discussion, but we've been using this branch for a few weeks without any issues.
The initial motivation for this PR was our suite having large spec files that were the lower bound of the time needed for a complete CI run, and we couldn't scale out any further. With switching to balancing by example, we achieve near-perfect distribution of work per worker and finish the run in optimal time.
As a bonus, this allows us to run that large single file spec on multiple processes in local development without having to use something like parallel_split_tests.
There's a new flag added to the rspec command -
--job-builderwhich by default usesFileJobBuilder(the current implementation) and optionally allows the user to setExampleJobBuilder, the new implementation.