ci: balance server test shards by splitting the largest files - #12
ashutoshpw wants to merge 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
Closing: fork-weight validation shows this layer does not pay. Fork's own per-file timings (run 35655900272, pre-split, parsed from the three shard logs):
After the split (run 35693398182, 338 files):
Net: no balance win, extra setup cost, and the server shards are not the critical path anyway ( |
Problem
Test Servershards are unbalanced because Vitest partitions bysha1(path)contiguous slices, never by duration. From CI-sourced per-file timings (run35655900272, 338 files), file-time totals were 35.7s / 40.5s / 46.3s and job walls 193 / 226 / 217s — the slowest shard is ~17% above the mean, so it holds up the suite.Fix
Split the four dominant test files into coherent groups, preserving every test, assertion, and order (structure-preserving moves only):
src/git/GitManager.test.tssrc/git/GitManager.http.test.tssrc/provider/Layers/GrokAdapter.test.tssrc/provider/Layers/GrokAdapter.sessions.test.tssrc/server.test.tssrc/server.sessions.test.tssrc/serviceLauncher.test.tssrc/serviceLauncher.core.test.tsThe three-shard simulation (implementing Vitest's exact algorithm — sha1 of
"/" + path-relative-to-apps/server, sorted, contiguous ranges) predicts 39.9 / 43.3 / 39.3s, max/mean 1.06. Four shards were simulated and rejected: they add runner minutes and buy nothing while theTestjob (~424s) is the critical path.Evidence
35655900272.apps/server; none needed moving.ci.ymlcomment now reflects the real resolved count (338 files, was 239).Diff note: the ~13k inserted lines are moved test bodies, not edits — review by test names, not line counts.
Stack
#9 (ci: batch short jobs) ← #11 (ci: skip the desktop build on documentation-only changes) ← this PR: ci: balance server test shards
Merge in order; after the previous layers merge, this PR is retargeted to
main.Manual Testing Guide
✓ <file> (N tests) <ms>lines from theTest Server 1/2/3job logs of run35655900272, apply the sha1 partition described above, and confirm the three-shard totals land near 39,890 / 43,332 / 39,278 ms with the four split files' halves distributed as simulated.gh run view <id> --repo ashutoshpw/t2code --json jobs— confirmTest Server 1/2/3all pass with a tight spread (baseline 193/226/217s; expect a visibly smaller max-min gap).Testssummary counts per shard against run35655900272.apps/server/vite.config.tsstill setsfileParallelism: false, and review the diff as moves (test names before/after) rather than rewrites.