Repository navigation
test(cli): size each case of the hook-timeout refusal pin to a measured vitest list child, past vitest's 5000 ms default - #25026
Conversation
…test list child Every case in hook-timeout-override-refusal.test.ts blocks on one `vitest list --filesOnly` child of the package. The two controls list the whole package and ran past vitest's 5000 ms default on a contended Test Core shard. Each case now carries VITEST_LIST_BUDGET_MS (25000), 3x the slowest measured control child (8160 ms) rounded up to the next second. The measurements are stated beside the constant. No assertion changes. Claude-Session: https://claude.ai/code/session_01LmjU2x1faLZ39DVTFyVca6 Co-authored-by: Claude <noreply@anthropic.com>
…ded runs The six runs taken after the budget landed read a slower control child (8685 ms) than the six before it (8160 ms), and one refusal child read 5134 ms, past vitest's default. 3x 8685 rounded up to the next second is 27000. The comment states the readings over all twelve runs. Claude-Session: https://claude.ai/code/session_01LmjU2x1faLZ39DVTFyVca6 Co-authored-by: Claude <noreply@anthropic.com>
📓 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): |
席位核对 · ACCEPT
Accepted deviations:
Out-of-scope dispositions (one line each):
Landing: through the merge queue by this seat once every check on this head reads Generated by Claude Code |
Fixes #24927
Clause-②: no
What changes
One test file:
packages/cli/test/hook-timeout-override-refusal.test.ts(the pin for #18788).VITEST_LIST_BUDGET_MS = 27_000, with the readings that size it written beside it.vitest list --filesOnlychild of the package, so a case's wall time is that child's wall time.b9222dc70).What stays the same:
vitest listof the whole package.runVitestList(), the vitest config and the refusal code are unchanged. No other test file changes.Measured
All local readings come from a 4-vCPU container shared with sibling agents. Every run took the verify lock. The case durations come from vitest's JSON reporter. The "file" figure is the file's start-to-end time in the same report.
"Alongside" means this package's own Test Core slice ran at the same time, under the shard's flags. The flags are
OS_TEST_SHARD=1/3, which is the slice that holds this file, plusOS_TEST_TIERS=queueandVITEST_MAX_WORKERS=3fromscripts/vitest-worker-cap.mjs. The file's own runs used the same environment without the shard flag, because vitest refuses a shard count larger than a one-file population. "Heavy" is alongside, plus the file's runs pinned to CPU 3 (taskset), where they share the CPU with two busy loops.39444329582, jobTest Core (2/6)86d236071)7ce12e63a)5d37bdbf9)7ce12e63a, the head)How to read these runs:
Error: Test timed out in 5000ms.10 times over the 5 runs that kept its text. The other 6 runs kept only the JSON report, where both controls arefailedat 6982 to 8160 ms.--hookTimeoutrefusal read 5134 ms in one run and 5012 ms in another. At the default, both runs would have timed out. This is why the budget covers all four cases, not only the two controls.OS_TEST_SHARD=1/3, both projects, 161 files, 674 s) read the controls at 2920 and 2395 ms. The file started 629 s into that run, near its end, when most of the slice had finished.5d37bdbf9), the slowest control read 8685 ms. That is above the 8160 ms the 25000 was sized on, so the head re-sizes the budget to 27000.The children alone, timed outside vitest at idle with 6 runs each and the exact argv and env the cases use:
--testTimeout=1: 1993 to 2350 ms;--hookTimeout=1: 854 to 994 ms;--teardownTimeout=1: 846 to 1031 ms.Mechanism assumptions, checked
vitest listof the package; the refusals exit at config load and stay fast." Partly confirmed.--filesOnly, it globs and does not import any test module. So the card's "collects the whole package" overstates the work. The cost is starting vitest, resolving both projects and globbing: about 2.2 s idle, against about 0.9 s for a refusing child.runVitestList()might fire first." The first half is falsified. There is no child timeout.execFileSyncis called with notimeoutoption, and its default is none.withTimeoutin@vitest/runner4.1.11 checks the elapsed time when the body returns. That is why the card's reds read 7335 and 7897 ms rather than 5000: each red is the child's full wall time, judged after the child finished.Test Corejob's wall is 50 minutes, and its stall guard fires after 10 minutes without output.scripts/measure-test-shard-timings.mjs(FILE_BUDGET_SECONDS) grades a file's measured wall time in the hourly window, and this change does not move that wall time. See the acceptance notes.Why this route
--projector a file filter. That changes the question from "a run of this package" to "a run of part of it", and the card forbids a weakened control.Tests and gates
All at
7ce12e63a(git rev-parse --short HEAD), the PR head, unless a row names another commit.pnpm --filter '@objectstack/cli^...' buildunder the verify lock:VERDICT command-exit 0.pnpm --filter @objectstack/cli build:VERDICT command-exit 0. The package was built because the slice's integration files spawndist, as CI's slice leg does.pnpm --filter @objectstack/cli exec vitest run --project unit(the whole unit layer, 315 files) under the lock:Test Files 315 passed (315),Tests 4650 passed (4650),VERDICT command-exit 0. This file read 3001 and 2518 ms for its controls there.pnpm --filter @objectstack/cli typecheckunder the lock:VERDICT command-exit 0, includingcheck:test-typecheck: OK. The file is intsconfig.test.json's program:tsc --listFilesOnlycounts it once, and it has no entry intest-typecheck-debt.json.integrationlayer was not run locally on its own. This diff does not touch it, and CI'spnpm testruns both layers. The heavy and alongside runs above ran the slice's integration files beside the file.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 53 commands at7ce12e63a. Each was run with its exit code captured before any pipe.PREREQUISITE NOT MET), so it is NOT MEASURED here:pnpm check:dual-build-cjs-loadsneeds every workspace package'sdist. CI runs it.--ranreconciliation:✓ dispatch-gates --ran: 53 derived famil(ies) accounted for — 52 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3).check:init-service-contract,check:live-db-isolation,check:meta-type-normalized,check:optional-error-sink,check:resume-authority-declared,check:route-envelope,check:runner-env-posture,check:settings-bind-window,check:startup-registry-verdict,check:verify-stand-inandcheck:wildcard-fallthrough.pnpm lint(eslint over the repo,--no-inline-config): exit 0, no findings.86d236071, not merged forward. Of the 11 commits that reachedmainsince, one touchespackages/cli:62bc129308adds one test file and editssrc/commands/migrate/apply.ts. That adds one file to what a control child lists, and touches nothing this file, the vitest config or the refusal reads.git merge-treeagainstorigin/mainis clean.No changeset (
skip-changeset)Only a
*.test.tsfile underpackages/cli/test/changes.@objectstack/cli'sfiles[]isdist,README.mdandCHANGELOG.md, andtsconfig.build.jsonbuildssrconly.pnpm --filter @objectstack/cli buildat7ce12e63a(VERDICT command-exit 0), then a search of everythingfiles[]ships:VITEST_LIST_BUDGET_MSappears in 0 files underdist,README.mdandCHANGELOG.md;dist;ValidateCommandappears in 2 files underdist.Acceptance notes
// test-budget:header is declared here, because nothing lists the file today.spawns the real producer once per single-cause fixture. Each case spawns the real config load once, for one flag.timeoutonexecFileSyncwould bound it. That is not added here, because it would changerunVitestList()'s failure shape (a killed child reports anullstatus, which the helper's own assertion rejects), and the card asks for a budget only.Generated by Claude Code