Skip to content

Fork CI health: attention - #491

Merged
lab-agent-np[bot] merged 4 commits into
mainfrom
nplez1/issue-490
Nov 27, 2026
Merged

lab-agent-np[bot] merged 4 commits into
mainfrom
nplez1/issue-490

Conversation

@lab-agent-np

@lab-agent-np lab-agent-np Bot commented Nov 27, 2026

Copy link
Copy Markdown

Fixes #490

Two reds in the daily fork-health issue, one cause each.

1. The nightly (check-nightly-liveness) — fixed. fork-main-tests reddened on main at 830852634b4 (run
45942815750, 2026-11-27): shard 17/24 failed
src/renderer/src/components/sidebar/WorktreeCard.merge-marker.test.tsx with Test timed out in 20000ms on the
first 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 charged
to 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 settings on the experimental card style, and the
default-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, and
the two }, 20_000) timeouts go with it. Module scope has no per-test budget to cross, and both bodies are now
synchronous, so an abandoned body has no await to 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, no
test removed, no assertion changed.

2. check-fork-lane-red — cleared, not re-fixed. The red was fork-performance-contracts on main from
2026-11-25, and the code fix had already landed in #485 (61e5367006d); what was missing was a fresh verdict on
main, which is what that workflow's workflow_dispatch exists for. Dispatching it produced one (below), and
node local/check-fork-lane-red.mjs now prints PASS — 4 green on main, 1 with no verdict to read.

node local/check-nightly-liveness.mjs still prints ATTENTION and should: it only reads scheduled runs on
main, and main's newest one predates this fix. It clears with the first 04:53 UTC schedule after this merges —
a dispatch cannot clear it, by design.

LOCAL-PATCHES.md carries the red, the measurement, the change and the verification, plus one follow-up the review
found unrecorded: local/ci-shard-timings-overlay.json weighs this file at 3,894 ms by a metric that excludes
collection, 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.
  • Unit gate (orca-queue node local/gate-unit.mjs) — not required and not run: the diff is
    src/renderer/src/components/sidebar/WorktreeCard.merge-marker.test.tsx (source tree) and LOCAL-PATCHES.md
    (doc), and neither is a global input (package.json, the lockfiles, config/**, a root tsconfig*.json,
    src/packages/**, src/shared/**, or a path outside the source/test/doc/tooling trees).
  • The runner that reddened decides, so the fix was dispatched rather than trusted from a Mac:
    • 45953273363 at 9a0bd1b944c — all 24 shards
      green
      , 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: 60 covers it.
    • 45954673133 at 2afcbbda095 — green on the
      post-review code (the static import moved beside the other imports; the mock factory now records why
      buildState must stay lazy). The commit after it, 38dfce752eb, touches LOCAL-PATCHES.md only.
    • 45953276075 at 830852634b4 on main —
      fork-performance-contracts green 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.mjs unchanged, and local/nightly-linux-known-red.json is still
    entries: [] — nothing was absorbed.

Decisions

  • Fix the cause instead of buying margin. Fork CI health: attention #485's precedent for a slow CI test was to raise its timeout to
    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_000 arguments rather than raising them is deliberate: the project default
    is 30_000, and a budget sized for the graph is what hid the graph in the first place.
  • No allowlist entry. The issue forbids clearing a check by widening one, and it would have been the wrong
    fix anyway: this is a cost the file charges itself, not an environment red. nightly-linux-known-red.json stays
    entries: [], unit-known-red.json is untouched, and no REQUIRED / EXPECTED_TRIGGERS changed.
  • A fresh green verdict is the fix for the second red. fork-performance-contracts had been fixed on main
    a day before the issue was filed, and its every-other-day schedule was the only thing keeping the row red.
    Dispatching on main is what that workflow's own comment says the dispatch is for.
  • No per-test timeout, no async body. With the import at module scope there is nothing in either body that
    can await, so a body cannot be abandoned mid-flight — that abandonment, not the timeout itself, is what produced
    the second, false failure. A future await there would be charged to the 30 s default, which LOCAL-PATCHES.md
    records as the thing to watch.
  • Record, do not silently defer, the shard-weight follow-up. The overlay's metric excludes collection, so this
    change makes its number for this file less accurate than stale. It is shard balance rather than correctness, and
    --override cannot restore a file the threshold dropped, so the working remedies are written down where the next
    person regenerating the overlay will read them.
  • LOCAL-PATCHES.md even though nothing upstream-owned changed. It is where Fork CI health: attention #485's equivalent lives, it costs
    no check-upstream-file-comments budget (4,828/4,828, and the file is fork-added so it has none), and the red
    it 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

…, 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.
@lab-agent-np
lab-agent-np Bot merged commit 19a0a67 into main Nov 27, 2026
10 checks passed
@lab-agent-np
lab-agent-np Bot deleted the nplez1/issue-490 branch November 27, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fork CI health: attention

1 participant