Skip to content

ci: shard the test suite across parallel jobs - #3

Merged
apresmoi merged 1 commit into
mainfrom
ci/shard-test-suite
Aug 15, 2026
Merged

ci: shard the test suite across parallel jobs#3
apresmoi merged 1 commit into
mainfrom
ci/shard-test-suite

Conversation

@apresmoi

Copy link
Copy Markdown
Collaborator

Why

CI runs ~20 min. Root cause: ubuntu-latest is a 2-core runner, and node --test parallelizes at the file level — so the CPU-heavy dynamics build / DynamicsSession suites can't spread out and run nearly serially. (The same suite is ~2 min on an 18-core dev box.)

What

  • Split the single job into a fast check job (npm audit + typecheck) and a test job.
  • Shard test across 4 parallel jobs via node --test's built-in --test-shard=i/4, so wall time is the slowest shard, not the whole suite.

Expected: ~20 min → ~5 min, no test changes.

Notes

  • --test-shard splits by file count, not duration, so the heavy suites may not be perfectly balanced; bump the shard count (or hand-group the heavy dynamics build suites) if one shard stays slow.
  • The durable follow-up is to make those suites build the dynamics artifact once and reuse it across cases instead of rebuilding per test — that lowers the floor regardless of runner size.

@apresmoi
apresmoi merged commit 25b7156 into main Aug 15, 2026
5 checks passed
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