From efe7181ed3001419cae02ca49fe1eb583bdd1efd Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 27 Jul 2026 15:20:12 +0000 Subject: [PATCH 1/2] test(lint): give the lazy-deps dist probes the same cold-load timeout as their sibling (#3662) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Claude-Session: https://claude.ai/code/session_01G71ANZMJ6TgX2a4WQVHmpr --- packages/lint/src/lazy-deps.test.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/lint/src/lazy-deps.test.ts b/packages/lint/src/lazy-deps.test.ts index ee553fbc15..702eacd260 100644 --- a/packages/lint/src/lazy-deps.test.ts +++ b/packages/lint/src/lazy-deps.test.ts @@ -36,6 +36,12 @@ const LAZY_DEPS = ['typescript', 'sucrase']; const depLoaded = (cache: Record | undefined, dep: string) => Object.keys(cache ?? {}).some((p) => p.split(/[/\\]/).join('/').includes(`/node_modules/${dep}/`)); +// Every case below cold-loads sucrase + typescript (~1.5 MB / ~9 MB) — in-process +// for the behavioral case, in a spawned child `node` for the dist probes. On a +// loaded runner (dozens of parallel turbo tasks) that alone takes >5s, so vitest's +// default 5s timeout flakes while the assertion set is pure contract, not latency. +const COLD_LOAD_TIMEOUT_MS = 30_000; + describe('lazy dependency loading (kernel boot-path contract)', () => { it('no src file eagerly imports a lazy dep (import type only)', () => { // Static `import`/`export ... from ''` executes at module init in @@ -85,7 +91,7 @@ describe('lazy dependency loading (kernel boot-path contract)', () => { { encoding: 'utf8' }, ); expect(out).toContain('OK'); - }); + }, COLD_LOAD_TIMEOUT_MS); it.skipIf(!existsSync(join(distDir, 'index.js')))('built ESM dist does not load a lazy dep until a react page is validated', () => { const out = execFileSync( @@ -101,7 +107,7 @@ describe('lazy dependency loading (kernel boot-path contract)', () => { { encoding: 'utf8' }, ); expect(out).toContain('OK'); - }); + }, COLD_LOAD_TIMEOUT_MS); it('loads each dep lazily in-process and the gates still work', async () => { const req = createRequire(import.meta.url); @@ -129,8 +135,5 @@ describe('lazy dependency loading (kernel boot-path contract)', () => { }); expect(depLoaded(req.cache, 'typescript')).toBe(true); expect(props.some((f) => f.rule === 'react-prop-missing-required' && /objectName/.test(f.message))).toBe(true); - // Cold-loading sucrase + typescript in-process takes >5s on a loaded CI - // runner (dozens of parallel turbo tasks) — the default 5s timeout flakes - // there while the assertion set is pure contract, not latency. - }, 30_000); + }, COLD_LOAD_TIMEOUT_MS); }); From 127bcd6c4cdf861c9cf151e1329f0797f6742784 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 27 Jul 2026 15:21:55 +0000 Subject: [PATCH 2/2] chore(changeset): declare the lazy-deps timeout fix as releasing nothing (#3662) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Claude-Session: https://claude.ai/code/session_01G71ANZMJ6TgX2a4WQVHmpr --- .changeset/lazy-deps-dist-probe-timeout.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .changeset/lazy-deps-dist-probe-timeout.md diff --git a/.changeset/lazy-deps-dist-probe-timeout.md b/.changeset/lazy-deps-dist-probe-timeout.md new file mode 100644 index 0000000000..6105873484 --- /dev/null +++ b/.changeset/lazy-deps-dist-probe-timeout.md @@ -0,0 +1,13 @@ +--- +--- + +test(lint): give the lazy-deps dist probes the same cold-load timeout as their sibling (#3662) + +The two dist probes in `lazy-deps.test.ts` spawn a child `node` that cold-loads +sucrase (~1.5 MB) and typescript (~9 MB) to prove neither arrives at import time. +That cold load alone exceeds vitest's default 5s timeout under a whole-repo +`pnpm test` (dozens of parallel turbo tasks), so the ESM probe was observed +failing at 5928ms on `execFileSync` — pure latency, not a contract failure. The +in-process sibling already carried an explicit 30s timeout; hoisted that rationale +into one named `COLD_LOAD_TIMEOUT_MS` shared by all three cold-loading cases. +Test-only flake fix; releases nothing.