test: repo-wide vitest console-intercept disarm + arrival gate (#10374) - #13522
Merged
os-project-manager merged 3 commits intoAug 30, 2026
Merged
Conversation
…cept (#10374) The late-console teardown race (#10374) is removed per suite by disableConsoleIntercept: true; this gate makes the invariant hold for the whole moving population — 38 vitest configs on 2026-08-21 were 43 by 2026-08-30, every arrival with the intercept armed, and 29 more packages run vitest with no config file at all. The sweep that applies the setting to all of them follows in this branch; the gate is what keeps the next arrival from undoing it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
…rypoint (check:entry-guard) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
…running packages (#10374) Measured across the whole population (8,066 intercepted console RPCs per full-repo run carrying 61,086 lines, every one discarded by the non-TTY default reporter): 33/72 suites emit nothing and are disarmed for free; dogfood alone carries 67% of the volume; and the one suite that actually flaked (showcase) sits mid-tail at 340 lines — volume does not predict the trigger, so the mechanism is removed everywhere rather than the trigger narrowed anywhere. 42 configs edited, 29 created for packages that ran vitest with no config; dogfood's setting is per-project because inline projects do not inherit the root value (measured on vitest 4.1.10). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
Contributor
📓 Docs Drift Check
What this run could not see
Coarse fallback — 158 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
os-project-manager
marked this pull request as ready for review
August 30, 2026 16:39
os-project-manager
enabled auto-merge
August 30, 2026 16:40
os-project-manager
deleted the
claude/issue-10374-console-intercept-shape
branch
August 30, 2026 17:04
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 #10374
The amplifier itself is vitest's and stays upstream (raising it there was ruled optional and non-blocking by triage); this PR closes the repo's exposure to it, completing the card's re-graded scope: measure the per-suite cost, choose the shape, implement with the pin intact.
What this does
disableConsoleIntercept: truein each package-rootvitest.config.ts: 42 configs edited, 29 created for packages that ran vitest with no config at all, 1 already disarmed (examples/app-showcase, CI flake:@objectstack/example-showcase#testfails on mass sys_*Find operation failed+Acquire connection error: operation timed out— hit a merge-queue build and a PR run within 2h on unrelated prose-only diffs #10293 / PR test(showcase): disarm the vitest console-forwarding teardown race that reddens a green suite (#10293, #10374) #10605, untouched).packages/qa/dogfoodcarries the setting per project: measured on vitest 4.1.10, inlineprojectsdo NOT inherit a root-leveldisableConsoleIntercept(probe: root disarm + inline project + logging test — the console RPC still arrived, byte-identical to the armed control), so a root-only spelling there would be declared-but-not-enforced.scripts/check-console-intercept-disarm.mjs+ a lint.yml step: every package whose scripts run vitest must carry the package-root disarm;disableConsoleIntercept: falseat package root is refused; a projects config must disarm every project block; fixture configs below the package root (the pin's positive control) are exempt by scope. Self-tests pin the verdict directions — a comment about the setting does not satisfy it, a string literal spelling it does not satisfy it, and the root-inert projects trap fails loudly.The measurement (the shape decision rests on it)
Population, re-derived on
origin/main240aad5 — the card's denominator was stale in both directions:vitest.config.tscount). All 72 verified as real invocations — everytestscript is plainvitest run [--passWithNoTests].defineConfighits 43/43 config files.Per-suite cost of disarming — one full run of each of the 72 suites with a counting reporter on
onUserConsoleLog(the traffic the disarm removes). Instrument controls: negative — showcase as-is reads 0 calls; calibration — showcase with the intercept forced back on reads 93 calls / 340 lines against the 72 / 285 recorded on 2026-08-21 (same magnitude; the suite grew). All 72 suites passed during measurement (52,268 tests, 0 failures).Totals: 8,066 intercepted console RPCs per full-repo run, carrying 61,086 lines — every one previously serialized to the main thread and then discarded by the non-TTY default reporter (
silent: 'passed-only').Distribution (lines of previously-discarded console output per run; cum% of total):
The full per-suite table is in the card's
os-dev-reportcomment.Why repo-wide, against the other two shapes:
examples/app-showcase— the ONE suite that actually flaked, twice — sits mid-tail at Migrate documentation site to Fumadocs with monorepo structure and shared content #11 with 340 lines. Volume does not predict the trigger; the trigger is a single console write landing in a ~1ms load-widened window, and 39 of 72 suites emit at least one. A targeted shape needs an oracle for "logs during teardown", which is precisely the load-dependent, statically-invisible property that made the original defect take two sightings and a reproduction to diagnose. It also narrows the trigger rather than removing the mechanism — the weaker answer the landed CI flake:@objectstack/example-showcase#testfails on mass sys_*Find operation failed+Acquire connection error: operation timed out— hit a merge-queue build and a PR run within 2h on unrelated prose-only diffs #10293 disarm was explicitly chosen against. And the population outruns any target list: five new configs in nine days, all armed.vitest.shared.tslives outside every package's turbotestinputs ($TURBO_DEFAULT$is package-local), so editing it re-runs nothing unlessturbo.jsonglobalDependenciesalso grows; it adds a cross-package import edge to all 72 configs (the input-radius classcheck:cross-package-test-inputsexists to police); and it still needs the same arrival gate for config-less packages. Its single-source-of-truth benefit is had cheaper: the mechanism docblock lives once (showcase config), each added line carries a two-line pointer, and the gate's failure text carries the recognition signature.stdout | file > testattribution header and per-task buffering. 33 suites pay nothing; 26 more pay ≤ 500 lines each. The heavy emitters are heavy because registry/engine loggers default loud under test — filed separately as finding: test-suite console chatter measured at 61k lines per full repo run — dogfood 41k and objectql 5k dominate, and the loudness is a logger-default question #13517 (a logger-default question, per the boundary the showcase docblock already records; re-arming interception would not remove that cost, only hide it again while paying an RPC per write and re-exposing every suite to the race).Verification
OK: 72 vitest-running package(s), every one disarms console interception at the package root.git hash-object== HEAD blob and emptygit diff HEAD; gate green again.check-test-completeness.mjs: NOT MEASURED locally (exit 3PREREQUISITE NOT METby design).Out of scope, recorded: #13517 (test-log console volume is a logger-default question). Raising the two upstream fix shapes with vitest stays optional per triage and is not done here.
Generated by Claude Code
Generated by Claude Code