Uh oh!
There was an error while loading. Please reload this page.
test(lint): give the lazy-deps dist probes the same cold-load timeout as their sibling (#3662) - #3708
Merged
Merged
Conversation
… as their sibling (#3662) The two dist probes spawn a child `node` that cold-loads sucrase (~1.5 MB) and typescript (~9 MB) to prove neither comes in at import time. That cold load alone exceeds vitest's default 5s timeout on a loaded runner — a whole-repo `pnpm test` with dozens of parallel turbo tasks — so the ESM probe was observed failing at 5928ms on `execFileSync`. The failure is pure latency: the assertions only check which deps ended up in the child's require cache. The in-process sibling already knew this and carried an explicit 30s timeout. Hoist that rationale into a single named `COLD_LOAD_TIMEOUT_MS` and apply it to all three cold-loading cases, so the contract is stated once instead of drifting per case. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G71ANZMJ6TgX2a4WQVHmpr
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
…ing (#3662) Empty-frontmatter changeset — the sanctioned "this PR releases nothing" declaration the Check Changeset gate looks for. The change is test-only. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G71ANZMJ6TgX2a4WQVHmpr
os-zhuang
marked this pull request as ready for review
July 27, 2026 15:28
Uh oh!
There was an error while loading. Please reload this page.
os-zhuang added a commit
that referenced
this pull request
Jul 28, 2026
…clarations that never did (#3718) (#3840) `client.ai` and the real AI service were disjoint sets: three methods whose URLs no repo has ever mounted (deleted in v17) against 12 mounted routes with no SDK expression. v17 closed the first half; this closes the second. The SDK now expresses every AI route meant to be tenant surface — ai.chat / ai.chatStream (POST /ai/chat, JSON | UI Message Stream), ai.complete, ai.models, and ai.conversations.{create,list,get,update,delete,addMessage}. `chat` forces `stream: false` because the endpoint streams by default; `chatStream` returns a promise for an async iterable so the request (and any HTTP error) happens on call, not on first iteration. Breaking, and none of it had an implementation anywhere: the Ai{Nlq,Suggest, Insights} schemas/types are replaced by the wire shapes of the real routes, DEFAULT_AI_ROUTES is deleted (8 default registrations, not 9), and AiProtocol is deleted — the real server contract is IAIService + IAIConversationService. /api/v1/ai/ becomes a bounded prefix exemption in the capstone (#3642): only `ai.*` may use it and the namespace must still be reaching it. The reachability check lives where the routes are, in cloud's ai-route-ledger conformance test, which reads buildAIRoutes() and drives this SDK against it. The wildcard-only bound stays 0. Refs #3718, #3708, #3642, #3563
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 freeto 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.
Closes#3662.
问题
packages/lint/src/lazy-deps.test.ts的两条 dist 探针(行 81 / 行 90)各自 spawn 一个子node,在子进程里冷加载sucrase(~1.5 MB)与typescript(~9 MB),用来证明这两个依赖不会在 import 时被带进来。这个冷加载本身在整仓pnpm test(几十个 turbo 任务并行)下就会超过 vitest 默认的 5s ——issue 里实测 ESM 那条在execFileSync上耗时 5928ms。失败纯粹是延迟:断言只检查"子进程的 require cache 里最终有哪些依赖",与耗时无关。
同一文件的 in-process 兄弟用例早就知道这件事,显式带了
30_000并写了注释;两条 dist 探针做同样的冷加载却沿用默认 5s。改动
把那段说明提成一个具名常量
COLD_LOAD_TIMEOUT_MS = 30_000,三条冷加载用例(两条 dist 探针 + in-process 兄弟)统一引用它。理由只写一次,不会再出现"兄弟改了、探针没改"的漂移。断言一行未动。验证
先
pnpm --filter @objectstack/lint... build把 dist 构建出来,让两条skipIf探针真的跑起来而不是被跳过:空载机器上 in-process 那条已经 3.2s,离 5s 很近 —— 与 issue 描述的负载下越界一致。
另外单独验证了"第三参数超时经由
it.skipIf(...)确实生效"(vitest 4.1.10),用一次性探针跑同一段 6.5s 的 body:该探针文件已删除,不在本 PR 内。
包内全量:
32 test files / 447 tests passed;eslint packages/lint/src/lazy-deps.test.ts干净。关于 changeset
纯测试稳定性修复,不涉及运行时行为,按 AGENTS.md Post-Task Checklist #3 本身不需要发版说明。但
Check Changeset门禁要求每个 PR 至少新增一个 changeset 文件,所以补了一个空 frontmatter 的 —— 工作流注释里明确把它列为"this PR releases nothing"的认可写法(仓库既有先例:.changeset/authz-ledger-flow-runas.md,同样是 test-only)。它声明的正是"不发版",与上面那条并不冲突。