ci(jest-balance): run the balancer weekly instead of twice a month - #123927
Merged
Conversation
The balancer records per-file jest runtimes and publishes jest-balance.json, which frontend.yml downloads to spread test files evenly across shards. That data goes stale as tests are added, deleted, and rewritten, so on a 1st/15th cadence the shard split can drift for up to two weeks and leave one shard as the long pole of the frontend job. Moving to Sundays at 00:00 UTC keeps the timings within a week of master and lands the refreshed artifact before the work week starts. The trade is roughly two extra full jest matrix runs per month. Claude-Session: https://claude.ai/code/session_01KvHjyGdpfxN4KkEmMxhdNr
scttcper
approved these changes
Sep 9, 2026
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.
The idea behind this is that recently for 2 weeks we had a less optimal split, which pushes time spend waiting up. If we run slightly more often then it'll be less optimal for less time.
Here we can see that after 14th up to the 31st the pink line,

Test (4,8)was an outlier, fixed after the run on the 31st. These are the dates when the balancer ran.The jest balancer runs the full jest matrix, records per-file runtimes, and publishes
jest-balance.json.frontend.ymldownloads that artifact from the most recent successful master run and uses it to spread test files evenly across shards.On the current
1,15cadence the timing data can be up to two weeks behind master. Tests get added, deleted, and rewritten in that window, so the shard split drifts and one shard ends up as the long pole of the frontend job. Weekly keeps the data within seven days and lands the refreshed artifact before the work week starts.0 0 * * 0(Sundays, 00:00 UTC) rather than a weekday slot, so the extra matrix runs land when CI is quiet. The cost is roughly two more full jest matrix runs per month.No feature flag — the schedule change takes effect once this merges to master. The
workflow_dispatchtrigger is untouched, so the balancer can still be run on demand.https://claude.ai/code/session_01KvHjyGdpfxN4KkEmMxhdNr