Repository navigation
test(ci): changedSinceMergeBase builds its repositories once, and each lookup gets its own test budget - #9073
Conversation
…h lookup gets its own test budget "lists the branch's own changes and never makes a full clone shallow" ran about 35 git processes in one 30 s case: it built an origin and a full clone (about 14 git calls, plus the clone's and the push's own processes), then made four lookups of about 5 calls each, one of them a fetch that fails. It takes under a second alone, but a full node-project run on a busy machine timed it out at 30 s: on a loaded runner, starting a process is what costs. The two repositories are now built once, in beforeAll, and each lookup is its own case: a local base, the remote base (with the clone still not shallow), and a missing or absent base. The repositories, the lookups and the assertions are the same; no budget changes. Building the repositories is now the largest step; it runs under the hook's own 30 s budget. On one CPU shared with 40 busy loops, the old case times out at 30 s (it needed 38 s); the three cases take 4, 5 and 3 s.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: The accessibility audit did not run on this pull request. It runs after merges to Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
This test-only change looks ready to merge. It keeps the same repositories, lookups and assertions, and gives each changedSinceMergeBase lookup its own 30 s budget. The three cases pass alone and in shuffled order because none of them changes the shared fixture. Keep in mind that the shared beforeAll now carries about half of the old case's git work, so under heavier load it becomes the next timeout threshold, as the description notes.
[Automated review]
Maintainer impact
In full node-project runs on a busy machine,
.github/scripts/a11y-pr-contracts.test.mjs› changedSinceMergeBase › "lists the branch's own changes and never makes a full clone shallow" times out at 30 s. Alone it takes under a second.The case ran about 35 git processes in one budget. It built an origin and a full clone (about 14 git calls, plus the clone's and the push's own processes), then made four lookups of about 5 calls each, one of them a fetch that fails. On a loaded runner, starting a process is what costs.
Intended invariant
Unchanged: against a local or a remote base, the branch's own changes are listed; a complete clone is never made shallow; a base that can't be found, or no base, gives no list.
Change
This is test only:
beforeAll.The repositories, the lookups and the assertions are the same. No budget changes.
Tradeoff: building the repositories is now the largest step, under the hook's own 30 s budget; the cases depend on that shared fixture (they don't change it). Rejected: a larger budget only moves the threshold.
Evidence
A repeatable load: the test pinned to one CPU (
taskset) shared with 40 busy loops.Scope
Testing
pnpm exec vitest run --project node .github/scripts/a11y-pr-contracts.test.mjsfor i in $(seq 40); do taskset -c N node -e 'for(;;){}' & done, then step 1 undertaskset -c Nwith-t changedSinceMergeBase, on main and on this branch.Prior art: #9007 edits other cases in this file (spec-record paths), with no overlap; no other open pull request touches it (searched the changed files of all open pull requests).
Local gates at 1fdb412: ESLint, Prettier and
pnpm check:repoare clean; the file passes (46 tests); the full node project passes apart from two lock tests incache.test.mjs, which fail on main on this machine too (#8520 fixes them).