New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests: Shard JS unit tests #60045
Tests: Shard JS unit tests #60045
Conversation
449fbcf
to
094f8ae
Compare
A minute for each test run with shards is great. I'm curious how long the test step would be for 2 shards, though. |
Yep! I'll pause this work for about a week, but before proceeding I plan to do some testing to find a sweet spot by testing different numbers of shards. |
f01829d
to
01a190a
Compare
Testing runs:
This is only 1 run for different shard numbers so is far from perfect but gives us an idea of where the sweet spot is. Clock time is the time reported for the action. I think it includes time waiting for the workers to be ready. 4 shards seems like a good number. It's the fastest run overall, and is not a large jump in accumulated time (occupying workers for more time that other workflows could use) from 3. |
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's give it a shot! I agree that 4 seems to be the current sweet spot. Added a few small change requests to address before merging. But no need to re-review.
Co-authored-by: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com>
2a982ec
to
6c5cf1a
Compare
Split out JS date unit tests Shard main JS unit tests into 4 shards. By sharding the tests, they can run in parallel on different runners. This allows the job to complete in less time. Testing suggests the time is reduced by around 50% from 4m to 2m. Co-authored-by: sirreal <jonsurrell@git.wordpress.org> Co-authored-by: desrosj <desrosj@git.wordpress.org>
Small note, whenever changing job names like this (for what was formerly a required check for merging into trunk), the required status checks may also need to be updated in the repo settings to include the new job names (under the branches tab). Access to that may vary so it might require asking someone else to do it. |
Sorry about that, @talldan! I forget sometimes that they are associated with the human-readable names assigned. I wish that they were by workflow file instead. Noted for the future though. Thanks! |
What?
See this comment for findings on different numbers of shards.
Anecdotally, the JavaScript unit tests run in ~2 minutes (parallelized on 4 workers * 2 node versions) instead of ~3:45 currently on trunk.
Follow up to #59904.
Why?
We can speed up the JS unit tests by sharding them — they're split up and different tests are run in parallel on different workers.