Skip to content

ci: refresh the Node legs' recorded times, and fail when the record falls a tenth behind - #11272

Merged
cixzhang merged 2 commits into
mainfrom
ci/test-node-durations
Nov 11, 2026
Merged

cixzhang merged 2 commits into
mainfrom
ci/test-node-durations

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Who this helps

Authors whose pull request runs the Node tests. test-node (1/4) ran 518–834 s against its 15-minute limit, and on #9810 it hit the limit after vitest had finished green. The four legs are split by recorded per-file times (scripts/vitest-shard-sequencer.mjs on scripts/lib/duration-split.mjs), but the record was stale.

Cause

scripts/vitest-node-durations.json recorded 830 Node test files while 1,057 run. The slow CLI suites added since had no time: theme-hunt (245 s), theme-stress (270 s) and eight swizzle-proof parts (up to 161 s each). The sequencer counts a file with no time as the median, about 0 s, so it treated them as cheap and could put several in one leg.

What changes

  • Recorded times: re-recorded with the sequencer's own record mode from the Main workflow's six Node legs (run 43050442090, all green). It now covers 1,057 files.
  • Guard: a new test in scripts/vitest-shard-sequencer.test.mjs fails when more than one in ten of the Node project's test files has no recorded time, so the record cannot fall far behind unnoticed. It reads the project's include and exclude lists from vitest.config.ts and lists files with fs.globSync, and its failure names the regeneration command. It does not catch a few slow files missing from an otherwise fresh record; re-recording does. On main's record it fails (238 files unrecorded); here it passes.
  • Unchanged: the same 4 test-node jobs, names, split code and 15-minute limit.

Estimates

Wall time per leg ≈ 160 s + 0.33 s per summed test-second, fitted to the six Main legs. PR runners have run up to about 1.2× slower.

Plan Legs Max summed test-seconds Estimated wall per leg
Before (stale record) 4 1,590 about 11.4 min (seen up to 13.9)
After (this pull request) 4 1,399, all four legs equal about 10.4 min (about 12.7 on a slow runner)
A 5th leg (proposed separately) 5 1,119 about 8.8 min (about 10.8 on a slow runner)

CI impact

+0 jobs. The same four legs, balanced; the slowest leg falls by about a minute.

…the suite

scripts/vitest-node-durations.json recorded 830 Node test files while 1,057 run;
theme-hunt, theme-stress and eight swizzle-proof parts had no time, so the
sequencer counted each as the median (about 0 s) and they could share one leg.
The file is re-recorded from the Main workflow's six Node legs (run
43050442090), and a test fails when more than one Node test file in ten has no
recorded time.
@vercel

vercel Bot commented Nov 11, 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 Nov 11, 2026 6:41pm UTC

Request Review

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

astracat-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 11, 2026, 7:09 PM UTC

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · adef207

Storybook · Sandbox · built from this PR's head

Package size: no published package changed; no new dependencies.

Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested. The regenerated durations file is right: it is exactly what the sequencer's record mode writes from the cited Main run, and it balances the four Node legs. The new guard needs two fixes before this lands.

  • The guard promises more than it checks: its title says new slow suites "cannot pile into one leg" and the description says missing slow suites "show up in review", yet it counts files, not time, so a record missing all 22 slow suites that main's file lacks (theme-hunt, theme-stress and swizzle-proof.1–8 among them) still passes at 3.1% while the slowest leg grows from 1,293 to 1,485 recorded test-seconds; reword the test title, the description and the pull request title to what the test proves, that the record cannot fall more than one file in ten behind unnoticed.
  • The guard's regex (scripts/vitest-shard-sequencer.test.mjs:38-41) hand-copies the node project's globs and turns packages/**/src/** into packages/[^/]+/src/, so it skips the 21 theme suites under packages/themes/*/src/ that the project runs; read the node project's include and exclude lists from vitest.config.ts, as uiTestRoots in .github/scripts/fs-guard-tests.mjs already does for ui, and delete the copy.

Optional: name the regeneration command in the guard's failure message, since that failure lands on whichever pull request crosses the line.

Claims and files checked
  • Claim: the legs split by recorded per-file times through scripts/vitest-shard-sequencer.mjs and scripts/lib/duration-split.mjs: verified (vitest.config.ts sequence.sequencer; vitest-shard-sequencer.mjs:44-50).
  • Claim: test-node (1/4) hit its limit on #9810 after vitest finished green: verified (cancelled at 15 min 16 s, 47 s after its last file passed).
  • Claim: test-node (1/4) ran 518–834 s; pull-request runners run up to 1.2× slower: not checked (timings of other runs).
  • Claim: the record held 830 files while 1,057 run: verified (830 entries at the base; the head's 1,057 are all collected).
  • Claim: theme-hunt (245 s), theme-stress (270 s) and eight swizzle-proof parts (up to 161 s) had no time: verified.
  • Claim: a file with no time counts as the median, about 0 s: verified (duration-split.mjs:28-33; the median is 0.2 s).
  • Claim: re-recorded with record mode from Main run 43050442090, all green, covering 1,057 files: verified (byte-identical reproduction from its six Node leg logs).
  • Claim: the guard uses the Node project's vitest.config.ts globs: false (the regex misses 21 theme suites).
  • Claim: missing slow suites then show up in review: false (all 22 slow suites main's file lacked can be missing and the guard passes).
  • Claim: main's file fails the guard at 22.8% and this one passes: verified (0.2275 on the base record; 15/15 on the head).
  • Claim: the same four test-node jobs, names, split code and 15-minute limit: verified (only the two files below change).
  • Claim: estimates of 1,590 before, 1,399 per leg after and 1,119 with five legs: verified on the record's own files; on the 1,067 files CI splits, the base record's peak is 1,798.
  • Claim: wall time ≈ 160 s + 0.33 s per test-second: not checked (the author's fit).
  • Claim: +0 jobs: verified (no workflow change).
  • Title: "require them to cover the suite": false (nine in ten of a hand-copied list).
  • File scripts/vitest-node-durations.json: clear.
  • File scripts/vitest-shard-sequencer.test.mjs: the two findings above.

Automated review (maintainer link)

Comment thread scripts/vitest-shard-sequencer.test.mjs Resolved
Comment thread scripts/vitest-shard-sequencer.test.mjs Resolved
@cixzhang
cixzhang marked this pull request as ready for review November 11, 2026 18:06
…t.config.ts

It listed files with a hand copy of the globs that already missed the theme
suites under packages/themes/*/src/. It now reads the node project's include
and exclude lists and lists the files with fs.globSync. Its title says what it
proves, that the record cannot fall more than one file in ten behind
unnoticed, and its failure names the regeneration command.
@cixzhang cixzhang changed the title ci: refresh the Node legs' recorded times, and require them to cover the suite ci: refresh the Node legs' recorded times, and fail when the record falls a tenth behind Nov 11, 2026
@cixzhang
cixzhang marked this pull request as draft November 11, 2026 18:33
@cixzhang
cixzhang marked this pull request as ready for review November 11, 2026 18:44

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved. Both earlier findings are fixed: the guard's test title, the description and the pull request title now describe what it checks, and it reads the node project's globs from vitest.config.ts, so it counts exactly the 1,067 files Vitest collects. The regenerated durations file is exactly what the sequencer's record mode writes from the cited Main run, the guard fails on main's record (238 of 1,067 files unrecorded) and passes here, and CI is green on this head.

Optional: the config reader repeats the block regex in uiTestRoots (.github/scripts/fs-guard-tests.mjs); one shared reader would leave a single place to update if the project format changes.

Claims and files checked
  • Claim: test-node (1/4) ran 518–834 s against its 15-minute limit: verified in substance (in ten pull-request CI runs from the hour before this pull request it took 492–853 s when it passed, and once hit the limit).
  • Claim: on #9810 it hit the limit after Vitest had finished green: verified (its test-node (1/4) was cancelled after 15 min 16 s, after its last file passed).
  • Claim: the legs split by recorded per-file times through scripts/vitest-shard-sequencer.mjs and scripts/lib/duration-split.mjs: verified (vitest.config.ts:112; vitest-shard-sequencer.mjs:44-50).
  • Claim: the record held 830 files while 1,057 run: verified (830 entries at the base; 1,057 recorded from the cited run).
  • Claim: theme-hunt (245 s), theme-stress (270 s) and eight swizzle-proof parts (up to 161 s) had no time: verified (absent at the base; 245.2 s, 270 s and 83.8–161.2 s here).
  • Claim: a file with no time counts as the median, about 0 s: verified (duration-split.mjs:28-33).
  • Claim: re-recorded with record mode from Main run 43050442090, all green, covering 1,057 files: verified (byte-identical reproduction from its six Node leg logs).
  • Claim: the guard fails above one file in ten unrecorded, reads the include and exclude lists from vitest.config.ts, lists files with fs.globSync and names the regeneration command: verified (vitest-shard-sequencer.test.mjs:34-59; its list equals Vitest's node collection).
  • Claim: it does not catch a few slow files missing from an otherwise fresh record: verified (10% of 1,067 allows 106 unrecorded files).
  • Claim: on main's record it fails (238 files unrecorded); here it passes: verified (0.223 on the base record; 10 of 1,067 here; 15/15 tests pass locally and in CI).
  • Claim: the same four test-node jobs, names, split code and 15-minute limit: verified (only the two files below change).
  • Claim: wall time is about 160 s plus 0.33 s per summed test-second, fitted to the six Main legs: verified (within about a minute of each leg of the cited run).
  • Claim: pull-request runners have run up to about 1.2× slower: verified (33 pull-request legs ran 0.88–1.25× that model).
  • Claim: estimates of 1,590 test-seconds before, 1,399 per leg after and 1,119 with five legs: verified on the record's 1,057 files; on the 1,067 files CI splits, the old record's slowest leg is 1,798, so the gain is larger than stated.
  • Claim: +0 jobs, and the slowest leg falls by about a minute: verified (no workflow change; 11.4 to 10.4 minutes by the model).
  • Title: "fail when the record falls a tenth behind": verified.
  • File scripts/vitest-node-durations.json: clear.
  • File scripts/vitest-shard-sequencer.test.mjs: clear (one optional note above).

Automated review (maintainer link)

This branch was successfully deployed

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

Labels

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.

1 participant