Skip to content

Commit fd968df

Browse files
committed
test(spec): 给 13 个 compiler-API 导出面 pin 一个符合真实工作量的超时 (#4796)
这一族 pin 都要对全部 16 个公共入口建一次 ts.createProgram,天然秒级。 实测:空闲机器 ~2-3s;CI 分片上 turbo 把 spec#build 与 #test 并发跑在 同 4 vCPU 上,争抢推到 5.0-5.6s —— 恰好骑在 vitest 默认 5s 线上。 一个上午三条 pin 超时(state-machine / sync-retirement / tenant), 每次都把不相干的 PR 踢出合并队列,并曾被误诊为构建 OOM(#4845)。 30s 约为实测争抢峰值 5 倍;真挂死仍由 10 分钟 stall guard 兜底。 长期修法(导出面做成构建期产物、pin 只比对)在 #4796 跟踪。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0176qgxgCXTJCUv4YFLtusP9
1 parent f4847a6 commit fd968df

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
---
3+
4+
test(spec): 给 13 个 compiler-API 导出面 pin 一个符合真实工作量的超时(#4796)
5+
6+
发布面零变化 —— 只改 `packages/spec/vitest.config.ts``testTimeout`,不影响任何
7+
产物内容,故为空 changeset。
8+
9+
这一族 pin(每个退役/双源 PR 各留一个,现有 13 个)都要对全部 16 个公共入口建一次
10+
`ts.createProgram`,天然是秒级工作。实测:空闲机器 ~2-3s;CI 分片上 turbo 把
11+
`@objectstack/spec#build``#test` 并发跑在同 4 vCPU 上,争抢把它推到
12+
5.0-5.6s —— 恰好骑在 vitest 默认 5s 超时线上。一个上午三条 pin 超时
13+
(state-machine / sync-retirement / tenant),每次都把一个不相干的 PR 踢出合并队列,
14+
并被误诊为构建 OOM(#4845 记录了那次误诊与更正)。
15+
16+
30s 约为实测争抢峰值的 5 倍;真挂死仍由 CI 的 10 分钟 stall guard 兜底 —— 这个
17+
数字只阻止「健康但受争抢」的运行被读成失败。长期修法(把导出面做成构建期产物、
18+
pin 只比对不现场解析)在 #4796 跟踪。

packages/spec/vitest.config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ export default defineConfig({
77
globals: true,
88
environment: 'node',
99
include: ['src/**/*.test.ts', 'scripts/**/*.test.ts'],
10+
// [#4796] This package carries 13 export-surface pin tests (one per
11+
// retirement/dual-source PR) that each build a ts.createProgram over all
12+
// 16 public entry points — inherently seconds-scale work. Measured cost:
13+
// ~2-3s on an idle machine, 5.0-5.6s on a CI shard where turbo runs
14+
// @objectstack/spec#build CONCURRENTLY on the same 4 vCPUs. vitest's 5s
15+
// default sat exactly on that line: three pins timed out in one morning
16+
// (state-machine / sync-retirement / tenant), each ejecting an unrelated
17+
// PR from the merge queue. 30s is ~5x the measured contended worst case;
18+
// genuine hangs are still caught by CI's 10-minute stall guard
19+
// (run-with-stall-guard.mjs), which is the real hang detector — this
20+
// number only stops healthy-but-contended runs from reading as failures.
21+
// The durable fix — precompute the export surface as a build artifact and
22+
// have the pins compare instead of re-resolving — is tracked in #4796.
23+
testTimeout: 30_000,
1024
coverage: {
1125
provider: 'v8',
1226
reporter: ['text', 'json', 'html'],

0 commit comments

Comments
 (0)