Skip to content

Commit d40f43a

Browse files
os-zhuangclaude
andauthored
fix(spec): set testTimeout 60s for this package's vitest run (#4850) (#4856)
packages/spec/vitest.config.ts never set testTimeout, so every case ran under vitest's 5000ms default. Twelve tests load the TypeScript compiler in-case and type-resolve the whole export surface (ts.createProgram + getTypeChecker), which is seconds of work by construction. Measured on an idle runner the slowest such case is 3.4s against a 5000ms budget — green on a PR branch, too thin on a merge-queue runner building several PRs at once. Five failures in one night, all inside the queue, each evicting an unrelated PR. Set at the config layer so all twelve are covered, and so a thirteenth is covered on arrival — PR #4506 set the same 60s value case-by-case and only covered the ones red at the time. Stop-the-bleeding only; the underlying per-run TypeScript compilation cost stays tracked in #4796. Claude-Session: https://claude.ai/code/session_015Br2xsJsczFsTR9bvbh2Ny Co-authored-by: Claude <noreply@anthropic.com>
1 parent 59568ce commit d40f43a

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
"@objectstack/spec": patch
3+
---
4+
5+
fix(spec): give this package's vitest run a 60s `testTimeout` — stop evicting unrelated PRs from the merge queue (#4850)
6+
7+
`packages/spec/vitest.config.ts` never set `testTimeout`, so every case in the
8+
package ran under vitest's **5000ms** default. Twelve tests in `src/` load the
9+
TypeScript compiler inside the case and type-resolve the whole export surface —
10+
`ts.createProgram` + `getTypeChecker`, then unalias each symbol and chase
11+
`originOf` — which is seconds of work by construction, not a hang:
12+
13+
```
14+
api/rest-server · automation/state-machine · automation/sync-retirement · cloud/tenant
15+
data/driver · integration/connector · kernel/package-dependency-dual-source
16+
studio/action-location-retirement · system/environment-artifact · system/notification
17+
ui/app · ui/view
18+
```
19+
20+
Measured on an idle runner the slowest of these cases takes **3.4s** against a
21+
5000ms budget — enough margin to stay green on a PR branch, and not enough on a
22+
merge-queue runner building several PRs' batches at once. That is exactly the
23+
observed signature: five failures in one night, all inside the queue, none on a
24+
PR branch, each one evicting a PR that had nothing to do with `spec` (#4755,
25+
#4788, #4823, #4822 twice).
26+
27+
`testTimeout: 60_000` matches the value PR #4506 gave these same cases
28+
case-by-case, but applied once at the config layer so all twelve are covered —
29+
and so a thirteenth added later is covered on arrival instead of leaking through
30+
the way the per-case list did. 60s is ~17x the slowest measured case, so it
31+
absorbs queue contention without masking a genuine hang.
32+
33+
This is a **stop-the-bleeding** change, not a fix for the underlying cost: 88% of
34+
those twelve files' test time is TypeScript compilation, ~39s of it, repeated per
35+
run. Hoisting the export-surface resolution into a build-time artifact is tracked
36+
separately in #4796, which stays open.
37+
38+
No runtime, schema or public API change — test configuration only.

packages/spec/vitest.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ export default defineConfig({
77
globals: true,
88
environment: 'node',
99
include: ['src/**/*.test.ts', 'scripts/**/*.test.ts'],
10+
// 12 tests in this package load the TypeScript compiler and type-resolve the
11+
// whole export surface (ts.createProgram + getTypeChecker). That is seconds of
12+
// work per case, and vitest's 5000ms default left no headroom on a loaded merge
13+
// queue runner — see #4850. Set at the config layer so all 12 (and any future
14+
// one) are covered, rather than per-case as PR #4506 did. Related: #4796.
15+
testTimeout: 60_000,
1016
coverage: {
1117
provider: 'v8',
1218
reporter: ['text', 'json', 'html'],

0 commit comments

Comments
 (0)