test(spec): the gate-spawning beforeAll in check-liveness.test.ts runs under the case budget (#21421) - #21433
Merged
objectstack-fleet[bot] merged 1 commit intoOct 2, 2026
Conversation
…s under the case budget The beforeAll of the tombstone describe spawns the whole liveness gate but, unlike the cases, ran under vitest's default 10 s hookTimeout: a 5 to 9 s run had 1 to 5 s of margin and a loaded shard spent it. It now passes GATE_BUDGET_MS (60_000, the cases' testTimeout) as its timeout. A new block at the end of the file parses the file's own source and fails when any lifecycle hook whose callback reaches spawnSync (directly or through runGate) does not pass GATE_BUDGET_MS, and when GATE_BUDGET_MS falls below the testTimeout declared in vitest.config.ts. Claude-Session: https://claude.ai/code/session_01YDt3PzwfrkuFzUBF89WPmM Co-authored-by: Claude <noreply@anthropic.com>
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
objectstack-fleet
Bot
deleted the
claude/issue-21421-liveness-hook-budget
branch
October 2, 2026 16:58
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 #21421
Clause-②: no
The one hook in
packages/spec/scripts/liveness/check-liveness.test.tsthat spawns the whole liveness gate (thebeforeAllof the tombstone describe, #19062) now runs under the budget its sibling cases already run the same gate under, instead of vitest's 10 s defaulthookTimeout. Test-only: no runtime, spec, config or published file changes.Changes
One file, +105 / -1 (1673 to 1777 lines).
const GATE_BUDGET_MS = 60_000;besiderunGate, with the reason it is a literal and not an import:vitest.config.tsexports no constant and cannot be imported from a test (its top level runs the filter preflights againstprocess.argv).});becomes}, GATE_BUDGET_MS);.runGateas reachingspawnSyncand finds lifecycle hooks (it cannot pass by scanning nothing);beforeAll/beforeEach/afterAll/afterEachwhose callback reachesspawnSync, directly or through another function in the file, passesGATE_BUDGET_MSas its timeout argument;GATE_BUDGET_MSis not below anytestTimeoutthatvitest.config.tsdeclares (the three declarations all read 60000 today).Not done, per the ruling: no skip, retry or quarantine, no change to vitest's
hookTimeout, no edit tovitest.config.ts.Hook census (A1)
22 lifecycle hooks in the file: 11
beforeAlland 11afterAll, nobeforeEach/afterEach. Exactly one reaches the gate, thebeforeAllof the #19062 describe (runGate(undefined, ['--json'])). The other tenbeforeAlls onlymkdtempSyncorcpSyncthe ledgers; everyafterAllisrmSync. The dispatch listed tenbeforeAlls; the file has eleven (the one in the #21127 block, which only creates a temp directory, was not in the list). It does not change the answer.Evidence
Tests 1 failed | 2 passed | 68 skipped (71), the failing case being the hook one, withbeforeAll at line 1412: timeout argument absent (vitest hookTimeout default, 10 s). Line 1412 is the old line 1401 plus the 11 lines added above it.1ea92df0fb:Test Files 1 passed (1),Tests 71 passed (71), run withvitest run --project localunder the shared verify lock (322.8 s on a shared box).scripts/ablation-replace.mjs, restored with blob equal to HEAD andgit diff HEADempty):GATE_BUDGET_MSlowered to 9_999: the config case turns red (expected 9999 to be greater than or equal to 60000), the other two stay green.10_000: the hook case turns red (beforeAll at line 1414: timeout argument 10_000), the other two stay green.pnpm --filter @objectstack/spec typecheckexit 0 (tsc --noEmit,check:scripts-typecheck,check:test-typecheckOK with its debt ledger unchanged).tsc --noEmit -p tsconfig.scripts.json --listFileslists the test file once, so the scripts program does compile it.Gates
dispatch-gates --commandsderived 59 commands for this diff. Reconciled with--ran: 59 accounted for, 55 run (exit 0), 4 NOT MEASURED, 0 unrun. The four arecheck:dts-closure,check:dual-build-cjs-loads,check:lean-entry-closureandcheck:sourcemap-no-sources-content: each exited 3 (prerequisite not met, no builtdist) and measured nothing. They read the published build, which this diff cannot reach:npm pack --dry-runonpackages/speclists 322 files and none underscripts/(positive control: 83 files underliveness/).check:query-options-erasureandcheck:type-check-debthit my 250 s cap on the first pass and were re-run with a larger cap: both exit 0.check:nul-bytesexit 0; control-character scan of the file clean.Changeset
Not published:
scripts/is outside the package'sfiles[](pack listing above).skip-changesetis applied.Acceptance notes
vitest.config.ts. It is self-contained; deleting it leaves the other two intact.localvitest project (vitest.repo-tests.jsondoes not list it), notrepo; both projects declare the sametestTimeout.39a912ea73, not merged forward. The commits that reachedmainsince do not touch this file,vitest.config.tsor the specpackage.json.Generated by Claude Code