Repository navigation
test: let Vitest projects own test deadlines - #10391
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f333023c40
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
[Medium impact] This PR appears safe to merge. SummaryMoves test and hook deadlines into Vitest project policy, while keeping separate checks for work that must finish quickly.
No actionable issues found. Tests were not run during this review. Reviews (3) · Last reviewed commit: "test: check the deadlines Vitest applies..." · Reviewed by Greptile |
|
I closed this session's #10384 as superseded and released the #10381 claim. I verified that #10391 at Additional full-coverage evidence:
Prepared policy integration refs on session-owned branches, preserving peer heads:
Full Additional readiness blocker on this PR: Apple job 132065617702 is cancelled with annotation “The job has exceeded the maximum execution time of 15m0s.” The six format verifiers occupy about 358 s of wall time, iNES reports 73 passes in 50.60 s, and the native/process phase is interrupted about 439 s after it starts, with no failed assertion shown. Scheduled main's Apple job also hit the same cap; both older isolated integration Apple jobs pass. This is a separate aggregate job-budget/capacity issue, not evidence that project-owned test deadlines are wrong. CPU and family memory were not measured. I have not retried it or changed its job budget; please include this limitation in readiness assessment. Follow-up: the replacement Apple job 132086129289 also exceeded the maximum 15m0s execution time (annotation verified). The complete-policy integration’s Apple job 132081464360 independently hit the same cap: format verifiers occupied about 388 s, iNES passed all 73 tests, and the native/process phase was interrupted after about 432 s with no assertion failure shown. Its coverage shards remain active; 35 other jobs currently pass. I have not started another retry or a competing Apple-job patch while this PR’s maintenance is active. |
Integrate the existing policy from PR #10391 at 0b8c9c7 without changing the peer PR branch. Resolve the overlapping fingerprint fixture to the policy owner's exact version; the resulting tree differs from that policy only by the desktop readiness fix. Validation: seven exact test files with V8 coverage pass (42 tests, 13 Linux-specific skips); full npm run check passes with zero errors. Linux integration qualification remains to run on this merge.
Integrate the existing policy from PR #10391 at 0b8c9c7 without changing the peer PR branch. Resolve the overlapping fingerprint fixture to the policy owner's exact version; the resulting tree differs from that policy only by the two unchanged XML member-count files. Validation: 112 focused tests across nine files pass, including all three XML CLI controls and ordinary project deadline probes; full npm run check passes with zero errors. No Linux qualification of this new merge is claimed.
|
Compatibility-merge claim withdrawn: your published Executed on pinned Node 24.22.1/npm 11.16.0:
The earlier two-worker desktop+policy full run |
0b8c9c7 to
82df66d
Compare
|
New current-head CI evidence at The test file is byte-identical to main |
|
Additional current-head Apple failure, separate from the earlier job-level cap: job 132111068584 finishes the native phase in 411.97 s with 416 passed / one failed / five skipped. I ran the unchanged exact file in isolation on native macOS arm64, Node 24.22.1/npm 11.16.0, with the hosted-runner config flag: one passed, 16.58 s wall, 3.27 s user+system CPU for the timed command, peak sampled process-family RSS 0.907 GB. Sampling sums RSS every 200 ms and can double-count shared pages or miss brief peaks; monitor and external OS-service CPU are unmeasured. The real attachment-preservation and final cleanup assertions pass. No CI-context reproduction or speedup is claimed. Source observation: |
Source projects allow 30 seconds and built projects 120 seconds, both doubled under coverage, and hooks share their project's deadline instead of Vitest's 10-second default. A long-running tag covers bounded workloads that need more. Co-Authored-By: gensokyo-dev <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Both projection modes read the same 130,000-callable analysis without changing it, so analyze the source once. Co-Authored-By: gensokyo-dev <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Explicit deadlines at or below the project deadline only shortened it: a literal 30-second value also disabled the coverage scaling, which timed out wide-capacity regressions on main. Workloads above the built deadline use the long-running tag. Deadlines derived from an operation budget remain. Co-Authored-By: gensokyo-dev <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Four wide-input regressions used a short per-test deadline as their only check against a slow but terminating implementation. Assert the same budgets explicitly so the project deadline only detects hangs. The composed-body test keeps its exact read count instead. Co-Authored-By: gensokyo-dev <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Probes in a source and a built project read each collected test's deadline, including test, suite, and module long-running tags, so a change in project inheritance or tag resolution fails directly. Both the policy and the probes read one set of base deadlines. Co-Authored-By: gensokyo-dev <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
82df66d to
47412e3
Compare
Summary
Built test shards fail on most PRs and on scheduled main runs because per-test
deadlines are hard-coded to the speed of one host. This PR moves test deadlines
to the Vitest project policy and removes the per-test literals that only
shortened them.
Problem and expected behavior
In the last 80 failed CI runs,
semanticFingerprintAccumulation.test.tstimedout 25 times, on main and on unrelated PRs.
asyncChunkCapacity.test.ts,byteEntropyWindowsIdentity.test.ts, and adeferredRuntime.test.tscleanuphook (Vitest's 10-second hook default) also timed out on main. These
130,000-element regressions do 20–35 seconds of linear work on an idle core:
about 190–270 µs per element, profiled locally. Their explicit
30_000deadline left no headroom on a shared runner.
A literal
30_000also disablesvitest.config.ts's coverage-aware 60-seconddefault. That is why scheduled full-qualification shards 5/6 and 6/6 failed with
"Test timed out in 30000ms" while coverage was enabled.
The suite had 533 literal test deadlines in 259 files: 164 at exactly the
30-second default and 137 below it. A deadline exists to turn a hang into a
named failure. A deadline below the project default catches no hang that the
default would not also catch; it only adds false failures under contention.
Change and scope
vitest.config.tsowns deadlines per project group: 30 s for sourceprojects and 120 s for built projects, which launch compiled CLI, MCP, and
provider processes. Coverage doubles every deadline, and so does hosted CI
(kept from test(ci): double test deadlines on hosted runners #10417, which doubled the root deadline on hosted runners), so
source tests still get test(ci): double test deadlines on hosted runners #10417's 60 s on hosted CI. Hooks share their project's deadline
instead of Vitest's 10-second default.
long-runningtag ({ tags: ["long-running"] }or// @module-tag long-running) gives bounded workloads that need more 300 s,doubled under coverage. It replaces the 150–240-second literals and
vi.setConfig({ testTimeout: 180_000 }).deadlines at or below their project deadline, plus 15 constants left unused.
It converted 26 longer ones to the tag. Every affected test now has a
deadline at least as long as before, with or without coverage. Comments that
only justified a removed literal went with it. The one explaining a
long-running parity sequence remains next to its tag.
CHROME_STARTUP_TIMEOUT_MS + 30_000,2 * preparationBudget + 30_000),where the test must outlive the inner deadline whose diagnostics it checks.
Also kept: the opt-in 30-minute real
buildComputerdeadline.semanticFingerprintAccumulationdrops the explicit 60 s from test(ci): double test deadlines on hosted runners #10417; thebuilt-project deadline (120 s, 240 s on hosted CI) now covers it. It also analyzes its 130,000-callable source once
and shares the result across both projection modes. Projection does not
mutate the analysis (checked with a deep-equality probe). The file goes from
70 s to 54 s locally.
slow but terminating implementation:
environmentStateWriteCopies, twoenvironmentStateWriteExplaintests, and the cyclic-inheritance bound ingetter_aliases. They now assert the same budgets as elapsed time. Thecomposed-body test keeps its exact read count instead. The other short
deadlines were reviewed: their tests already bound time through an inner
operation deadline, an elapsed assertion, or a result that names the
applied limit, or they guard only against a hang.
tests/support/testDeadlines.tsholds the base deadlines that the configapplies. Probe tests in a source project and a built project read each
collected test's
task.timeout, covering untagged tests and test, suite,and module tags. CI runs them with and without coverage.
docs/development/testing.mddocuments the deadline policy.Not included: making semantic-graph projection or static analysis faster per
element. That is product performance work beyond this CI fix. Job-level
timeout-minutesremain as runner backstops.Contribution scope: not applicable. This changes test infrastructure only.
Contract and boundary impact
vitest.config.tsproject policynow owns test and hook deadlines; tests no longer restate them.
Expected effects:
Evidence and regression coverage
ciTestProjects.test.tsresolves the real configunder each coverage flag form. It asserts the root, source-project, and
built-project test and hook deadlines, plus the
long-runningtag deadline.tests/boundary/filesystem/testDeadlines*.test.tsandtests/evaluation/testDeadlines.test.tscheck the deadline Vitest appliesto collected tests.
base and changed versions were compared after stripping test timeouts,
tags, and the removed constants. 274 are identical. The 6 that differ are
the intentional manual edits listed above. Every edited callee resolves to
Vitest's
it/test/describe, a hook, or a.extend/.skipIfalias.cdc4541ef,npm run test:focused -- tests/boundary/javascript/semanticFingerprintAccumulation.test.tsfailed both cases with "Test timed out in 30000ms" (70.5 s, 2.7 GB peak
RSS). Failing CI jobs include 131987684430 and 131991573508 (scheduled
main, coverage).
task.timeout. Without coverage:source 30,000, built 120,000, and
long-running300,000 for test, suite,and module tags. With
--coverage.enabled: 60,000, 240,000, and 600,000.Validation performed
npm run check:fast— typecheck and lint passed.vitest runon the deadline probes and the four elapsed-time tests, with and without--coverage.enabled— 6 files, 214 tests passed both ways. Under coverage the elapsed-time tests took at most 381 ms against 1 s and 5 s budgets.npm run docs:check— passed.oxfmt --checkon changed files — passed.npm run test:focused -- tests/boundary/filesystem/ciTestProjects.test.ts tests/boundary/javascript/semanticFingerprintAccumulation.test.ts tests/boundary/javascript/asyncChunkCapacity.test.ts tests/boundary/filesystem/installScript.test.ts tests/boundary/filesystem/wideDirectoryTraversal.test.ts tests/boundary/process/electronLaunchRejections.test.ts src/domain/analysisView/environmentStateWriteComposed.test.ts tests/boundary/cli/cliOutput.test.ts— 8 files, 157 tests passed (118.7 s, 3.0 GB peak).Compatibility, safety, and release
timeout still work; an explicit timeout still overrides the project deadline.
fails after its project deadline (up to 120 s for built tests) instead of a
shorter literal; job-level timeouts still bound the run.
Author readiness
Human owner: @gensokyo-dev
The author account is exempt from the readiness declaration (CONTRIBUTING.md); the human owner's review and evidence responsibilities still apply.
Before merge
type(scope): outcome.No issue is linked; the failures are documented above from CI job logs.
🤖 Generated with Claude Code