Repository navigation
test(scripts): hoist the whole-repository scan out of check-unused-dependencies' timed window - #8543
Conversation
…pendencies' timed window The three tests in `check-unused-dependencies.test.ts`'s `this repository` block each called `analyze(repoRoot)` and then read one field of the result. That is the same whole-repository walk — 47 manifests, >1000 files — paid for three times, each pass inside a bounded assertion window. On the push lane the suite runs under v8 coverage instrumentation, and there a single pass crosses vitest's 15 s `testTimeout`. All three tests then fail with `Test timed out in 15000ms` while the gate they exercise is green. Because the coverage thresholds live only on the merged 4-shard report — the shard legs override them to zero — one red shard skips the merge and the thresholds are never evaluated on that commit at all. Hoist the scan to module scope as `REPOSITORY_SCAN`, where the cost lands in the import phase that no `testTimeout` governs. Not a `beforeAll`, which would trade the 15 s `testTimeout` for the narrower 10 s `hookTimeout` — the same reasoning that moved `check-doc-links.test.ts`'s corpus walk to `ANCHOR_CORPUS`. No timeout was raised and no assertion was weakened: the three tests read the same three fields of the same verdict they read before. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
|
LANDED — Landing probe, on a re-fetched
|
| probe | expect | read |
|---|---|---|
REPOSITORY_SCAN |
> 0 | 4 (the declaration + three readers) |
} = REPOSITORY_SCAN; — the readers |
3 | 3 |
negative — } = analyze(repoRoot);, a per-test walk |
0 | 0 |
⭐ firing control — this repository, present before and after |
> 0 | 4 |
⭐ nonsense control — zzq-not-a-real-token-8479 |
0 | 0 |
not a git repository — which prints as no output and would have read as a clean zero if the exit code had not been captured. ⇒ Re-run from the repository, both zeros are exit 1 (a real no-match). ⭐ That is the same class as the $-anchor case on objectui#8465 today: a zero that is not a reading.
⛔ The merge is NOT the proof, and this card does not close on it
main's CI push run for 83d4fda16 is 34209955709, still in progress at 09:44Z. The claim this card makes is that the coverage gate has not been evaluated for 84 consecutive push runs; the only thing that falsifies that going forward is a green main push run, ⛔ not a merged PR.
⇒ This seat will read 34209955709 to completion and report the verdict here. Two outcomes, both stated in advance so neither can be narrated after the fact:
- Green ⇒ the coverage thresholds are evaluated on
mainagain for the first time since 2026-09-07T08:28:39Z, and this card is done. - Still red ⇒ there is a second failure behind the one that was fixed, and its name is the next deliverable.
⚠️ The dev flagged exactly this possibility rather than assuming its fix was sufficient:Test (coverage shard 2/4)failed on many runs across the streak — including the streak's first four, where it was the only red shard — and it never reproduced that one, so it has no name for it. ⇒ If shard 2 reds now, that is a new card, ⛔ not this one re-opened.
What is now on main
Three tests that each ran the same whole-repository walk (47 manifests, >1000 files) inside a bounded assertion window now read one hoisted REPOSITORY_SCAN computed at module scope, where the cost lands in the import phase that no timeout governs. ⛔ Not beforeAll, which would have traded the 15 s testTimeout for the narrower hookTimeout default. ⛔ No assertion changed, ⛔ no timeout raised, ⛔ no threshold lowered, ⛔ no continue-on-error, ⛔ no test skipped.
⭐ The class behind it is objectui#8545, and the same instance — same file, same assertion — was already filed weeks ago as objectui#8380, whose own suggested remedy was the timeout raise this PR deliberately refused.
Generated by Claude Code
Fixes #8479
The failing test, named
main's push-lane coverage gate has been unevaluated since 2026-09-07T08:28:39Z. The card and the triage comment both stop at "which test fails inside the coverage shard is not established". It is:Three timeouts. ⛔ The gate itself is green —
findingsis[]on every pass that completes. Nothing is wrong withcheck-unused-dependencies.mjs.Why the log never carried that summary
The shard step runs with
--reporter=blobas its only reporter, so no vitest failure summary is ever written to stdout. The full job log for101973830157is 397 lines end to end and contains a 15-minute silence between the##[group]Runline and the first test stdout. The summary was never emitted; no download channel would have produced it. Reproducing locally is the only way to get the name — which is what this PR did.(The
check-vi-mock-specifiers/check-vi-mock-inherit"the population COLLAPSED — sources: found 0, floor is 1000" text in that log's tail is fixture output from those gates' self-tests, exactly as the dispatch note cautioned. It is not the failure.)The cause
The three tests each call
analyze(repoRoot)and then read one field of the result —findings,counters,measured. That is the same whole-repository walk (47 manifests, >1000 files) paid for three times, each pass inside a bounded assertion window.On PRs the suite runs uninstrumented and each pass fits inside vitest's 15 s
testTimeout. The push lane runs the same 4-way shard split under v8 coverage (if: github.event_name == 'push'), and there a single pass crosses it. That is the entire difference between the two lanes.Because
coverage.thresholdslive only on the merged 4-shard report — the shard legs override them to zero — one red shard skips the merge and the thresholds are not evaluated at all. The sentinel has been reporting exactly that, correctly.The fix
Hoist the scan to module scope as
REPOSITORY_SCAN, where the cost lands in the import phase that notestTimeoutgoverns.Not a
beforeAll, which would trade the 15 stestTimeoutfor the narrower 10 shookTimeout. This is the same defect class and the same remedy as #8419, which movedcheck-doc-links.test.ts's corpus walk toANCHOR_CORPUSlast night.⛔ No timeout was raised. ⛔ No threshold was lowered. ⛔ No
continue-on-error. The three tests read the same three fields of the same verdict they read before; a real finding still reds them.Verification — same box, same command, before and after
The workflow's own command, copied from the job's
##[group]Runline, with--reporter=defaultadded so failures are named. Both legs ran under the shared heavy-verify lock.3bc187b7f(origin/main)Tests 3 failed | 8943 passed(37 tests | 3 failed) 82977mse4af215f1(this branch)Test Files 682 passed (682),Tests 8946 passed | 1 skipped(37 tests) 1992msSingle-file run after the fix shows where the cost moved:
Duration 7.89s (import 7.06s, tests 454ms).Control, so "shard 1 is green" is a reading and not an artefact of a query that cannot see red: the same command on the same tree without
--coveragewas already green before the fix (682 passed, exit 0, 12m04s) — the failure is coverage-lane-specific, and the instrumented leg is the one that changed verdict.Gates run locally:
check-changeset-presence(exit 0 — "No source or published contract of a released package changed in this range, so no changeset is owed"),check-control-bytes(exit 0, 6746 files),eslinton the changed file (exit 0). No changeset is owed and none is added; ⛔ noskip-changesetlabel, which this repository does not use.Corrections to the readings this card was dispatched with
branch=main&event=pushruns ofci.yml. Control in the same window: 119 successes, so the query returns green when green exists. Last green is unchanged:3c6394cb2@ 2026-09-07T08:28:39Z.coverage shard 1/4on all six" holds for that six-run window but not for the streak. The streak's first failure, run34107014367@272ea0302@ 2026-09-07T09:36:56Z, failed onTest (coverage shard 2/4)alone; shard 1 first joined four runs later, at0ea7054f8@ 09:52:35 — the commit that landed this gate (feat(tooling): gate a DECLARED-but-never-imported dependency, and remove the 37 this repository had #8304). Walking the streak, the failing shard is 2, then 1, then both, oscillating. Consistent with a per-test timeout whose file moves between shards as the file list grows.--reporter=blobalone it is never produced.GET /actions/artifacts/{id}/zipfailsCONNECT tunnel failed, response 403on its redirect to blob storage. The REST listing endpoints themselves work fine.Not fixed here, and deliberately not widened
Test (coverage shard 2/4)failed intermittently earlier in the streak and is not named by this PR — the last seven completed runs onmainshow shard 1 as the only red shard, so this change is what the live blocker needs. If shard 2 reds again after this lands, the gate still will not run, and that is a separate name to read. ⛔ Not folded in here.🤖 Generated with Claude Code
Generated by Claude Code