Skip to content

ci(tests): shard the bats suite 5 ways, not 4 — the main twin of the #1107 fix - #1162

Merged
fujibee merged 1 commit into
mainfrom
agdev-cc3-1107-shard-main
Sep 12, 2026
Merged

ci(tests): shard the bats suite 5 ways, not 4 — the main twin of the #1107 fix#1162
fujibee merged 1 commit into
mainfrom
agdev-cc3-1107-shard-main

Conversation

@fujibee

@fujibee fujibee commented Sep 11, 2026

Copy link
Copy Markdown
Owner

The main-targeted twin of the shard change already on integration/terminal-driver-v1 (#1160). Main is still 4-shard, so main PRs — including #1159 — keep hitting the same macOS 30-min cap. This unblocks them.

Why 4 shards overload one leg

shard-tests.sh seeds each pinned file at one shard's average share (total_tests/total), a value that grows with the suite while the pinned files' real cost does not. That over-reserves the two pinned shards, and the greedy pass fills the non-pinned shards first. On main the suite is 1742 @tests, so the worst-case non-pinned shard total*(N+2)/N^2 is 653 at N=4; a 4-shard macOS leg reaches the 30-min cap while still passing tests (a slow shard, not a hang — the workflow's own #848/#857 note).

This change

SHARD_TOTAL: 4 → 5 (+ the matrix and the display-name /N; test_ci_workflow.bats reads all three and is green at 5). Worst-case non-pinned shard 653 → 488, back under the cap with margin.

Five, not six: the account runs at most five macOS jobs at once (the concurrency header), so a sixth macOS shard would queue behind the other five of its own run.

Not the fix

The scaling property remains and is tracked in #847: pin_seed grows with the suite, and @test count under-values the wait-dominant files. The real re-fit (re-pin by measured seconds-per-test / cap the seed) waits for #1159's per-file timings.

…1107 fix

The same change already landed on the terminal-driver integration branch; this
is the main-targeted twin so main PRs stop hitting the macOS 30-min cap that the
4-shard split reaches on this suite too.

shard-tests.sh seeds each pinned file at one shard's average share
(total_tests/total), which grows with the suite while the pinned files do not,
over-reserving the two pin shards and pushing the real load onto the non-pinned
ones. main is 1742 @tests, so the worst-case non-pinned shard total*(N+2)/N^2
drops from 653 (N=4) to 488 (N=5), back under the cap with margin. Five, not six,
because the account runs at most five macOS jobs at once (the concurrency header).

test_ci_workflow.bats reads SHARD_TOTAL and the matrix and follows the /N name;
it is green at 5. This does not fix the scaling property (pin_seed still grows
with the suite); that re-fit is #847.
@fujibee
fujibee merged commit 59dc385 into main Sep 12, 2026
24 checks passed
@fujibee
fujibee deleted the agdev-cc3-1107-shard-main branch September 12, 2026 01:12
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.

1 participant