Repository navigation
Fork CI health: attention - #491
Merged
Merged
Conversation
…, not in a test budget fork-main-tests reddened on main at 8308526 (run 45942815750, 2026-11-27): shard 17/24 failed `WorktreeCard.merge-marker.test.tsx` with "Test timed out in 20000ms" on the first test, then a second, false failure 281ms later. The cost is the card's module graph, not the assertions. The same file took 17,462ms on the same runner the night before and passed (run 45758341047), while here it is 1.5s warm and the two tests themselves are 20ms and 3ms. Each test did its own `await import('./workspace-card/surface/WorktreeCard')`, so the cold transform was charged to that test's timeout: 20s against a 17.5s cost. That is also what the second failure was. A timed-out test body is abandoned rather than cancelled, so the first test's continuation ran during the second, left the module-level `settings` on the experimental card style, and the metadata row the last assertion reads was never rendered — which is why it failed in 281ms having just read the marker and the glyph as expected. One static import moves that cost to module scope, where no per-test budget applies, and leaves both bodies synchronous, so a body that outlives its budget cannot resume inside the next test. The per-test timeouts go with it: nothing left in either body can await.
… the wrong place to pay it Records the 2026-11-27 nightly red (run 45942815750), the 17,462ms measurement that made it a coin flip, and the green dispatch that replaces it (run 45953273363 at 9a0bd1b, 137ms for the same two tests).
…o bound; the import above the bindings it precedes The delta from the adversarial review of 9a0bd1b, all of it accuracy rather than behaviour: - the static import moves up beside the other imports. Vitest hoists it either way, so this changes no runtime order — but leaving it below the `let` bindings it evaluates ahead of read as if it ran after them, and the mock factory now says why it must stay lazy. - `testTimeout: 30_000` is the project default, so removing the `}, 20_000)` lines widens the budget to 30s rather than removing it. The entry said the opposite twice. - the shard's wall clock, not a claimed collect measurement: 102s against 103s on the green run before, which is the evidence that the 17s moved instead of vanishing. - 4,828/4,828 fork comments in upstream files, measured, not #485's 4,763. - test 1 covers both card styles; test 2 pins the default one. - the warm-Mac numbers are the before-fix ones, and the six-line comment is two. Also records the follow-up the review found unrecorded: the shard-timing overlay weighs this file at 3,894ms by a metric that excludes collection, so the next regeneration would drop it while the shard still pays ~17s.
The delta review of 2afcbbd found the one thing this entry still got wrong: `--override` refuses a file `selectEntries` already dropped (local/ci-shard-timings-overlay.mjs:302), and at 137ms this file falls under the 2,000ms threshold — so the instruction it recorded would have aborted the next import rather than kept the entry. The paragraph now says the weight has to be re-added by hand, or the metric taught to count collection. Documentation only: the test change and its green run are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #490
Two reds in the daily fork-health issue, one cause each.
1. The nightly (
check-nightly-liveness) — fixed.fork-main-testsreddened onmainat830852634b4(run45942815750, 2026-11-27): shard 17/24 failed
src/renderer/src/components/sidebar/WorktreeCard.merge-marker.test.tsxwithTest timed out in 20000mson thefirst test, and then failed the second test too, 281 ms later, on an assertion about a metadata row.
The cost was the card's module graph, not the assertions. Each test opened with its own
await import('./workspace-card/surface/WorktreeCard'), so the cold transform and load of that graph was chargedto the test's own timeout — and the file's line in the night before's green run
(45758341047) is 17,462 ms. The renders are
milliseconds: the second test, whose import was already cached, took 3 ms. So it was a 20 s budget against a
17.5 s cost, decided by how loaded the runner was.
The second failure was the first one's shadow. A timed-out Vitest body is abandoned rather than cancelled, so test
1's continuation ran during test 2, left the module-level
settingson the experimental card style, and thedefault-style metadata row the last assertion reads was never rendered — which is why it failed in 281 ms having
just read the marker and the glyph as expected.
One static
import WorktreeCard from './workspace-card/surface/WorktreeCard'replaces both dynamic imports, andthe two
}, 20_000)timeouts go with it. Module scope has no per-test budget to cross, and both bodies are nowsynchronous, so an abandoned body has no
awaitto resume from. The tests stay bounded by the project default(
testTimeout: 30_000,config/vitest.config.ts), which now covers only the renders. No allowlist widened, notest removed, no assertion changed.
2.
check-fork-lane-red— cleared, not re-fixed. The red wasfork-performance-contractsonmainfrom2026-11-25, and the code fix had already landed in #485 (
61e5367006d); what was missing was a fresh verdict onmain, which is what that workflow'sworkflow_dispatchexists for. Dispatching it produced one (below), andnode local/check-fork-lane-red.mjsnow printsPASS — 4 green on main, 1 with no verdict to read.node local/check-nightly-liveness.mjsstill printsATTENTIONand should: it only reads scheduled runs onmain, and main's newest one predates this fix. It clears with the first04:53 UTCschedule after this merges —a dispatch cannot clear it, by design.
LOCAL-PATCHES.mdcarries the red, the measurement, the change and the verification, plus one follow-up the reviewfound unrecorded:
local/ci-shard-timings-overlay.jsonweighs this file at 3,894 ms by a metric that excludescollection, so the next regeneration drops it under the 2,000 ms threshold while the shard still pays ~17 s.
Verification
pnpm tc— pass (4.1 s, then 0.8 s on the post-review delta).pnpm test src/renderer/src/components/sidebar/WorktreeCard.merge-marker.test.tsx --maxWorkers=2— 2 passed;the two tests now measure 20 ms and 3 ms against 1,506 ms and 3 ms before, with the same 1.5 s file total.
pnpm run check:code-quality:changed main— pass, 0 new findings across the changed files.orca-queue node local/gate-unit.mjs) — not required and not run: the diff issrc/renderer/src/components/sidebar/WorktreeCard.merge-marker.test.tsx(source tree) andLOCAL-PATCHES.md(doc), and neither is a global input (
package.json, the lockfiles,config/**, a roottsconfig*.json,src/packages/**,src/shared/**, or a path outside the source/test/doc/tooling trees).9a0bd1b944c— all 24 shardsgreen, and the file's own line reads 137 ms for its two tests where the same line read 17,462 ms the
night before. Shard 17's wall clock is 102 s against 103 s on the green run before it, so the 17 s moved into
the file's collection rather than vanishing, where the shard job's
timeout-minutes: 60covers it.2afcbbda095— green on thepost-review code (the static import moved beside the other imports; the mock factory now records why
buildStatemust stay lazy). The commit after it,38dfce752eb, touchesLOCAL-PATCHES.mdonly.830852634b4on main —fork-performance-contractsgreen on all three legs (ubuntu 2m43s, windows 3m10s, macos).node local/check-fork-lane-red.mjs— PASS (exit 0).node local/check-upstream-file-comments.mjs— 4,828/4,828, unchanged (the file is fork-added).node local/check-unit-shard-verdict.mjsunchanged, andlocal/nightly-linux-known-red.jsonis stillentries: []— nothing was absorbed.Decisions
120 s; here the same 20 s budget was being spent on a module graph the test does not assert. A static import
moves that cost to module scope, where no per-test budget applies, so the test keeps a real bound over what it
actually measures. Removing the
20_000arguments rather than raising them is deliberate: the project defaultis
30_000, and a budget sized for the graph is what hid the graph in the first place.fix anyway: this is a cost the file charges itself, not an environment red.
nightly-linux-known-red.jsonstaysentries: [],unit-known-red.jsonis untouched, and noREQUIRED/EXPECTED_TRIGGERSchanged.fork-performance-contractshad been fixed onmaina day before the issue was filed, and its every-other-day schedule was the only thing keeping the row red.
Dispatching on
mainis what that workflow's own comment says the dispatch is for.asyncbody. With the import at module scope there is nothing in either body thatcan await, so a body cannot be abandoned mid-flight — that abandonment, not the timeout itself, is what produced
the second, false failure. A future
awaitthere would be charged to the 30 s default, whichLOCAL-PATCHES.mdrecords as the thing to watch.
change makes its number for this file less accurate than stale. It is shard balance rather than correctness, and
--overridecannot restore a file the threshold dropped, so the working remedies are written down where the nextperson regenerating the overlay will read them.
LOCAL-PATCHES.mdeven though nothing upstream-owned changed. It is where Fork CI health: attention #485's equivalent lives, it costsno
check-upstream-file-commentsbudget (4,828/4,828, and the file is fork-added so it has none), and the redit explains is one a reader will meet again in the health issue's history.
Reviewed by claude/opus, high: R1 (6 minor/nit fixed), delta clean on R2 (1 minor fixed), R3 clean