Skip to content

test(ci): changedSinceMergeBase builds its repositories once, and each lookup gets its own test budget - #9073

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:test/a11y-pr-contracts-merge-base-own-budgets
Oct 31, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:test/a11y-pr-contracts-merge-base-own-budgets

Conversation

@vjeux

@vjeux vjeux commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

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:

  • The two repositories are built once, in beforeAll.
  • Each lookup is its own case: a local base; the remote base, with the clone still not shallow; a missing or absent base.

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.

  • Before (main 45b112c): the case times out at 30 s (it needed 38 s).
  • After: the three cases take 4, 5 and 3 s.
  • Unloaded, the whole file passes (46 tests).
  • Product: no source file changes.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  1. pnpm exec vitest run --project node .github/scripts/a11y-pr-contracts.test.mjs
  2. The load: for i in $(seq 40); do taskset -c N node -e 'for(;;){}' & done, then step 1 under taskset -c N with -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:repo are clean; the file passes (46 tests); the full node project passes apart from two lock tests in cache.test.mjs, which fail on main on this machine too (#8520 fixes them).

…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.
@vercel

vercel Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 30, 2026 11:12pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 30, 2026
@astracat-bot

astracat-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 30, 2026, 11:15 PM UTC

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: The accessibility audit did not run on this pull request. It runs after merges to main and before each release; pull requests that touch components run it with the ci:heavy-lanes label.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Oct 31, 2026
@cixzhang
cixzhang marked this pull request as ready for review October 31, 2026 02:37
@cixzhang
cixzhang merged commit b450ce6 into meta:main Oct 31, 2026
137 of 140 checks passed
@vjeux
vjeux deleted the test/a11y-pr-contracts-merge-base-own-budgets branch October 31, 2026 05:18

This branch was successfully deployed

1 active deployment
Preview — 1fdb4126 Deployed Oct 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants