Skip to content

ci(jest-balance): run the balancer weekly instead of twice a month - #123927

Merged
ryan953 merged 1 commit into
masterfrom
jest-balance-weekly
Sep 9, 2026
Merged

ci(jest-balance): run the balancer weekly instead of twice a month#123927
ryan953 merged 1 commit into
masterfrom
jest-balance-weekly

Conversation

@ryan953

@ryan953 ryan953 commented Sep 9, 2026

Copy link
Copy Markdown
Member

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.
SCR-20260909-jvcw


The jest balancer runs the full jest matrix, records per-file runtimes, and publishes jest-balance.json. frontend.yml downloads that artifact from the most recent successful master run and uses it to spread test files evenly across shards.

On the current 1,15 cadence 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_dispatch trigger is untouched, so the balancer can still be run on demand.

https://claude.ai/code/session_01KvHjyGdpfxN4KkEmMxhdNr

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
@ryan953
ryan953 requested a review from a team September 9, 2026 17:54
@ryan953
ryan953 marked this pull request as ready for review September 9, 2026 17:57
@ryan953
ryan953 requested a review from a team as a code owner September 9, 2026 17:57
@ryan953
ryan953 merged commit a5d10fe into master Sep 9, 2026
62 of 63 checks passed
@ryan953
ryan953 deleted the jest-balance-weekly branch September 9, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants