Repository navigation
test: the Node legs' split books idle swizzle-proof slices at their import, and records keep only Node-leg time - #11648
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Requesting changes. Most of the re-recorded times look right, and every Node leg passed inside its time limit on this head, but two of the new entries record time from a different CI job.
scripts/vitest-node-durations.jsonrecordssetup-canonical.test.tsat 187.6 s andnext.turbopack.test.mjsat 109.3 s, but both skip in every Node leg (they run only in thetest-buildjob, underASTRYX_CANONICAL_SETUP_BROWSER=1andASTRYX_TURBOPACK_E2E=1), so the sequencer books about 297 s of work that no Node leg does, and counting only Node-leg time the five legs split 1602 / 1414 / 1492 / 1599 / 1602 s rather than 1602 s each.
To fix it, set those two entries to 0, along with build-css.data-tokens.browser.test.mjs (2.3 s) and stylex-module-resolution.browser.test.mjs (0.3 s), which come from the same job, and update the description's "from the Node legs" and "1602 s each". A later re-record from the Node legs will not correct these values, because the recorder keeps the times of files a run does not reach.
Claims and files checked
- Claim: Node leg 1 of 5 runs into its job time limit and the watchdog fails it. The watchdog mechanism is verified in the CI bounds test; how often it happens is not checkable from the repository.
- Claim: the legs are uneven because the recorded times are stale. Verified: 22 Node test files had no time, and 511 times had drifted.
- Claim: a recent all-green run had legs of 14.5, 9, 7.7, 5.4 and 8.4 minutes. Not checkable, because the run is not named.
- Claim: every Node test file still runs exactly once. Verified: the splitter asserts it, and all five legs passed on this head.
- Claim: the record was re-recorded with the documented command from the Node legs of one run (865 files). False for five added entries, which match lines from the
test-buildandbuild-storybookjobs; the file's shape matches the recorder's output. - Claim: nothing else changes, and no package changes. Verified.
- Claim: the old record's split gives 1782 / 1575 / 1796 / 1279 / 1577 s and the new one 1602 s each, about 10% off the longest leg. The arithmetic reproduces with the record as the truth; counting Node-leg time, the new split is 1602 / 1414 / 1492 / 1599 / 1602 s.
- Claim: the file parses and formats cleanly. Verified.
- Claim: no public API, product behavior or internal context changes. Verified.
- File
scripts/vitest-node-durations.json: the finding above.
…rds wholly skipped files at 0; re-record
There was a problem hiding this comment.
Requesting changes. The four build-job times from the last review are now 0, and the recorder no longer reads other jobs' lines.
NODE_LEG_JOBinscripts/vitest-shard-sequencer.mjs:117matches onlytest-node (N/M), sorecordfinds no times in a Main workflow log, whose Node legs are namedtest-node (1)totest-node (6), although the record guard (scripts/vitest-shard-sequencer.test.mjs:92) says to regenerate from those logs; accepting/^test-node \(\d+(?:\/\d+)?\)$/and adding atest-node (2)line to the whole-run test fixes it.- The description says
scripts/vitest-shard-sequencer.test.mjspasses with 19 tests, but after the merge ofmainthe file holds 22, so please update the count.
On this head CI's test-node (2/5) was stopped by the time-limit watchdog after its heavy CLI files ran well past their recorded times; a rerun will show whether that was runner load.
Claims and files checked
- Claim: Node leg 1 of 5 often runs into its job time limit, and the watchdog names whichever file is running. The watchdog is verified in the workflow; how often it happens cannot be checked from the repository.
- Claim: on a recent all-green run the legs took 14.5, 9, 7.7, 5.4 and 8.4 minutes. Not checkable, because the run is not named.
- Claim: every Node test file still runs exactly once. Verified: the splitter throws unless each file lands in exactly one leg.
- Claim: the recorder on
mainread every job's lines, so the build job's runs of tests that the Node legs skip were booked to the legs. Verified: the base recorder has no job filter, and those tests run only under environment flags that the build job sets. - Claim: with a job column, only
test-node (N/M)lines count, and a single leg's own log reads as before. Verified as written, but the Main workflow's legs are excluded (first finding). - Claim: a file whose every test skips is recorded at 0. Verified, in code and in a test.
- Claim: the record is re-recorded with that recorder from one recent all-green run's Node legs (866 files). The record's shape matches the recorder's output, and the four build-job entries are 0; the run and the file count cannot be checked.
- Claim: tests cover a whole-run log with build-job lines and a wholly skipped file. Verified.
- Claim: no package changes; only the Node legs' split changes. Verified.
- Claim: with the new record the five legs split into 1542 s each. Verified with the leg-one reserve off; with it on, the first leg carries less by design.
- Claim: on the first head, CI's leg 1 took 9.5 minutes. Verified (9.45 minutes).
- Claim: no public API, product behaviour or internal context changes. Verified.
- Claim: the sequencer test passes (19). The file holds 22 tests at this head (second finding).
- File
scripts/vitest-shard-sequencer.mjs: the first finding. - File
scripts/vitest-shard-sequencer.test.mjs: no case covers the Main workflow's leg names (first finding); otherwise clear. - File
scripts/vitest-node-durations.json: clear; the earlier finding is fixed.
…avy CLI files in one leg
There was a problem hiding this comment.
Approved pending CI: four of the five Node legs are still running or queued on this head.
Both points from the last review are fixed: record now reads a Main run's test-node (N) legs as well as a pull request's test-node (N/M) legs (scripts/vitest-shard-sequencer.mjs:120, pinned by the whole-run test), and the description's test count matches the 22 tests CI ran. The recorder now ignores other jobs' lines and books a wholly skipped Node file at 0, while the record itself stays main's.
Claims and files checked
- Claim: on
main,recordread every job's lines in a whole run's log. Verified: the base recorder has no job filter. - Claim: the build job runs its own Node-project tests that every Node leg skips, so a re-record booked their times (setup-canonical 187.6 s, the Turbopack test 109.3 s and two browser tests) to the legs. Verified: those tests run only under flags the build job sets, and the first head's record carried exactly those values.
- Claim: a re-record books only time the Node legs spend. Verified for the job filter and the skipped rule, on fixed lines and on CI's own leg log.
- Claim: every Node test file still runs exactly once. Verified: the splitter is unchanged and its exactly-one-leg cases passed.
- Claim: with a job column, only a pull request's
test-node (N/M)or a Main run'stest-node (N)counts. Verified against both workflows' job names and the new test. - Claim: a single leg's own log has no job column and reads as before. Verified: CI's raw job log reads into all 246 of its files.
- Claim: a file whose every test skips in a Node leg is recorded at 0. Verified in code, in the test and on CI's log.
- Claim: tests cover both rules. Verified.
- Claim: no package changes and the durations record is unchanged. Verified: the record is byte-identical to
main. - Claim: an earlier re-record put the heaviest CLI files in one leg, which ran past its limit. Consistent with CI at the previous head, where Node leg 2 of 5 failed after 14 minutes; not re-measured.
- Claim: the record stays
main's until the split accounts for it. Verified. - Claim: no public API, product behaviour, visual or policy change, and no internal context. Verified.
- Claim: the sequencer test passes with 22 tests. Verified in CI on this head.
- File
scripts/vitest-shard-sequencer.mjs: clear. - File
scripts/vitest-shard-sequencer.test.mjs: clear.
…port when the run proves no target
There was a problem hiding this comment.
Requesting changes: booking idle swizzle-proof slices at their import is a sound fix for the leg skew, but it breaks two existing sequencer tests outside this pull request's own diff.
scripts/vitest-shard-sequencer.test.mjs:155and:192still build their expected legs without the newidleset, so on any checkout whose change reaches no component source or swizzle toolchain path (for example withSWIZZLE_PROOF_CHANGED=docs/README.md) both fail while the base passes, and this pull request passes only because it changesproof.mjs; pin the scope in the suite (vi.stubEnv('SWIZZLE_PROOF_ALL', '1')) or computeexpectedwithidleSwizzleSlices, and add a case that covers the idle branch.- The description says the slices total "about 2,160 s across seven slices" and booked "about 470 s per leg that held one", but the record has eight slices (2,338.5 s) and the four legs that held slices booked 441–655 s each, and the title's "only time the legs will spend" holds only when a run proves no target or every target.
CI's Node legs have not run on this head yet.
Claims and files checked
- Claim: on
main,recordread every job's lines in a whole run's log and booked build-job tests to the Node legs. Verified: the base recorder has no job filter. - Claim: the split books only time the Node legs will spend. Partly: true for runs that prove no target or every target; an affected run still books each slice at its full time.
- Claim: every Node test file still runs exactly once. Verified:
idlechanges only cost, every leg computes the same set, and the new split case checks it. - Claim: the slices are booked at their import alone when the run proves no target. Verified at
scripts/vitest-shard-sequencer.mjs:56and:171-180. - Claim: each slice reads the same scope first through the new
runScope, whichrunSliceuses, and the sequencer reads that scope at shard time. Verified atproof.mjs:488-506,:523andvitest-shard-sequencer.mjs:178. - Claim: the slices' recorded time is about 2,160 s across seven slices. False: eight slices, 2,338.5 s.
- Claim: on most pull requests the slice-holding legs finished early while the heavy CLI files piled into the rest, so leg 1 ran into its limit. Consistent with the computed base split (leg 1 at 1,362 s against 932–1,146 s); not re-measured.
- Claim: in a log with a job column, only
test-node (N/M)andtest-node (N)lines count. Verified at:123,:138-139and in the whole-run test. - Claim: a single leg's own log has no job column and reads as before. Verified: lines with fewer than three columns pass the filter.
- Claim: a wholly skipped file is recorded at 0. Verified at
:149-155and in the test. - Claim: tests cover both recorder rules. Verified.
- Claim: no package changes and the durations record is unchanged. Verified.
- Claim: on main's record, a run that reaches no component splits as 890 / 1116 / 1116 / 1115 / 1115 s. Verified within 4 s per leg.
- Claim: the old split booked about 470 s of idle slice time per leg that held one. False: four legs held two slices each, 441–655 s apiece.
- Claim: no public API, product behaviour, visual or policy change, and no internal context. Verified.
- Claim: the sequencer test (24) and the scope test pass. Partly: they pass on this change; the sequencer test fails 2 of 24 when the change reaches no component.
- Claim: new cases show the heavy files spread with idle slices and no scope is read without a slice. Verified, the second by code (the early return at
:173); no case covers the idle branch. - File
scripts/vitest-shard-sequencer.mjs: clear. - File
scripts/vitest-shard-sequencer.test.mjs: blocking (the two expected splits). - File
scripts/vitest-shard-sequencer.d.mts: clear. - File
packages/cli/test/swizzle-proof/proof.mjs: clear; one unused-binding note.
…ves; a case for each scope
There was a problem hiding this comment.
Requesting changes: the shard tests now expect the run's own idle set and the description's numbers match the record, but the new scope case fails whenever SWIZZLE_PROOF_ALL=1 is already set.
scripts/vitest-shard-sequencer.test.mjs:355expects all eight slices idle after stubbing onlySWIZZLE_PROOF_CHANGED, but Main's release re-check runs the Node legs withSWIZZLE_PROOF_ALL=1(.github/workflows/deploy.yml:224), so there the scope isalland the assertion at:362fails on every re-check; stubSWIZZLE_PROOF_ALLto''before the first assertion, or in the suite'sbeforeEachbesideVITEST_LEG_ONE_RESERVE.
Both points from the last review are fixed. CI's Node legs have not run on this head yet.
Claims and files checked
- Claim: before this change,
recordread every job's lines in a whole run's log, so build-job tests could be booked to the Node legs. Verified: the base recorder has no job filter. - Claim: a re-record keeps only Node-leg time. Verified at
scripts/vitest-shard-sequencer.mjs:123and:138-139, and in the whole-run test. - Claim: the split books the slices only in a run whose scope proves targets, and an affected run keeps each slice at its full recorded time. Verified at
:171-180. - Claim: every Node test file still runs exactly once. Verified:
idlechanges only cost, and the new split case checks every file lands once. - Claim: each slice reads the same scope first through the new
runScope, whichrunSliceuses, and the sequencer reads it at shard time. Verified atproof.mjs:488-506,:523andvitest-shard-sequencer.mjs:178. - Claim: the slices' recorded time is 2,338.5 s across eight slices. Verified against the record.
- Claim: on most pull requests the slice-holding legs finished early while the heavy CLI files piled into the rest, which is why leg 1 ran into its limit. Consistent with the computed base split (leg 1 at 1,362 s against 932–1,146 s); not re-measured.
- Claim: in a log with a job column, only
test-node (N/M)andtest-node (N)lines count. Verified. - Claim: a single leg's own log has no job column and reads as before. Verified: lines with fewer than three columns pass the filter.
- Claim: a wholly skipped file is recorded at 0. Verified at
:151-155and in the test. - Claim: tests cover both recorder rules. Verified.
- Claim: no package changes and the durations record is unchanged. Verified.
- Claim: on the record, a run that reaches no component splits as 890 / 1116 / 1116 / 1115 / 1115 s, where the four slice-holding legs book 441 to 655 s of slice time. Verified within 4 s per leg, and 441 / 623 / 620 / 655 s.
- Claim: no public API, product behaviour, visual or policy change, and no internal context. Verified.
- Claim: the sequencer test (25) passes as is and with a docs-only change, and the scope test passes. Verified; the sequencer test fails 1 of 25 with
SWIZZLE_PROOF_ALL=1. - Claim: new cases cover the heavy files spreading, the idle set per scope, and no scope read without a slice, and the shard tests use the run's own idle set. Verified, the third by code (the early return at
:173); the per-scope case is the one above. - File
scripts/vitest-shard-sequencer.mjs: clear. - File
scripts/vitest-shard-sequencer.test.mjs: blocking (the scope case at:355). - File
scripts/vitest-shard-sequencer.d.mts: clear. - File
packages/cli/test/swizzle-proof/proof.mjs: clear.
There was a problem hiding this comment.
Approved pending CI: the Node legs and the other required checks have not finished on this head yet.
Both points from the last review are fixed: the shard tests build their expected legs with the run's own idle set, and the suite clears SWIZZLE_PROOF_ALL itself, so the scope case also passes in Main's release re-check. The sequencer test passes 25 of 25 in every swizzle scope and on this branch merged with main.
- Optional: the
$commentinscripts/vitest-node-durations.jsonstill says a pull request that does not reach the slices leaves its legs uneven; that now holds only for a run that reaches some component, so it is worth a one-line update.
Claims and files checked
- Claim: before this change,
recordread every job's lines in a whole run's log, so build-job tests were booked to the Node legs. Verified: the base recorder has no job filter, and the build job alone runs those tests under their opt-in variables. - Claim: the earlier re-record booked 187.6 s and 109.3 s plus two browser tests from that job. Verified against that re-record.
- Claim: a re-record keeps only Node-leg time. Verified at
scripts/vitest-shard-sequencer.mjs:123and:139, and in the whole-run test. - Claim: the split books the slices only in a run whose scope proves targets, and an affected run keeps each slice at its full recorded time. Verified at
:171-180. - Claim: every Node test file still runs exactly once. Verified:
idlechanges only cost, and the new split case checks every file lands once. - Claim: each slice reads the same scope first through the new
runScope, whichrunSliceuses, and the sequencer reads it at shard time. Verified atproof.mjs:488-506,:523andvitest-shard-sequencer.mjs:178. - Claim: the slices' recorded time is 2,338.5 s across eight slices. Verified against the record.
- Claim: on most pull requests the slice-holding legs finished early while the heavy CLI files piled into the rest, which is why leg 1 ran into its limit. Consistent with the computed base split (leg 1 at 1,358 s against 928–1,142 s); the run history was not re-measured.
- Claim: in a log with a job column, only
test-node (N/M)andtest-node (N)lines count, and a single leg's own log reads as before. Verified: lines with fewer than three columns pass the filter. - Claim: a file whose every test skips in a Node leg is recorded at 0. Verified at
:149-155and in the test. - Claim: tests cover both recorder rules. Verified.
- Claim: no package changes and the durations record is unchanged. Verified.
- Claim: on main's record, a run that reaches no component splits as 890 / 1116 / 1116 / 1115 / 1115 s, where the four slice-holding legs book 441 to 655 s of slice time. Verified exactly on the record at the base.
- Claim: no public API, product behaviour, visual or policy change, and no internal context. Verified.
- Claim: the sequencer test (25) passes as is and with a docs-only change, and the scope test passes. Verified, also with a component change, the release re-check's environment and on this branch merged with
main. - Claim: new cases cover the heavy files spreading, the idle set per scope, and no scope read without a slice, and the shard tests use the run's own idle set. Verified at
scripts/vitest-shard-sequencer.test.mjs:330-378,:180-183and:203-207. - File
scripts/vitest-shard-sequencer.mjs: clear. - File
scripts/vitest-shard-sequencer.test.mjs: clear. - File
scripts/vitest-shard-sequencer.d.mts: clear. - File
packages/cli/test/swizzle-proof/proof.mjs: clear.
Maintainer impact
node scripts/vitest-shard-sequencer.mjs record run.logread every job's lines in a whole run's log (gh run view --log). The build job runs its own--project nodetests, which every Node leg skips, so a re-record booked their time (setup-canonical.test.ts187.6 s,next.turbopack.test.mjs109.3 s and two browser tests) to legs that never spend it.Intended invariant
A re-record keeps only Node-leg time, and the split books the swizzle-proof slices only in a run whose scope proves targets. When the scope is
affected, a slice proves only the targets that depend on the change, and it stays booked at its full recorded time. Every Node test file still runs exactly once.Change
The split now books the swizzle-proof slices at their import alone when this run proves no target. Each slice reads the same scope first:
proof.mjs's newrunScope, whichrunSlicenow uses. The sequencer'sidleSwizzleSlicesreads that same scope at shard time. The slices' recorded time (2,338.5 s across eight slices) is the time they take when a change reaches them. On most pull requests, which change no component, the legs holding the slices finished early while the heavy CLI files piled into the remaining legs. This is why Node leg 1 (and leg 2 on a re-record) ran into its time limit on many pull requests.In a log that carries the job column, only Node-leg jobs count: a pull request's
test-node (N/M)or a Main run'stest-node (N). A single leg's own log has no job column and reads as before.A file whose every test skips in a Node leg (
↓ … (N tests | N skipped)) is recorded at 0, so a time another job gave it can't stay booked.Tests for both rules.
Declared difference
None in any package.
scripts/vitest-node-durations.jsonis unchanged.On main's record, a run whose change reaches no component now splits as 890 / 1116 / 1116 / 1115 / 1115 s of actual test time (leg 1 keeps its reserved steps), where today the four legs that hold slices book 441 to 655 s of slice time that they do not spend.
Scope
Components: CI test sharding (durations recorder)
Testing
scripts/vitest-shard-sequencer.test.mjs(25) passes, both as is and withSWIZZLE_PROOF_CHANGED=docs/README.md;swizzle-proof/scope.test.mjspasses. New cases: idle slices let the heavy files spread (no leg takes more than two of eight); the slices are idle for a docs-only change and booked for a component change orSWIZZLE_PROOF_ALL=1; no scope is read when no slice is in the run. The shard tests compute their expected legs with the run's own idle set.