Fixes the recurring 5 s timeouts in Core's import-safety tests during full pnpm verify. Tests only.
Root cause
Four tests prove that importing a module has no side effects:
doctor-import
module-http-import
cli-bootstrap-platform-owner
cli-create-initial-owner (its first test)
Each does a cold dynamic import() of a large Core source graph inside the test body. Vitest transforms and evaluates that graph on demand, so the CPU-bound cost counts against the default 5 s per-test timeout. Ordinary test files import at the top level, outside any test timeout.
There is no subprocess, no shared resource and no test bug. The cause is plain CPU contention: under a full pnpm verify, Turbo runs every package's suite at once.
Measured on six cores:
Condition
Duration of these four tests
Alone
0.7–1.2 s
Core's suite alongside five other packages' suites (api, shell, module-pack, contracts, template), as in pnpm verify
3.0–5.4 s (doctor-import 5,400 ms)
Change
New:core/tests/support/import-safety.ts exports IMPORT_SAFETY_TEST_TIMEOUT_MS = 30_000, with the reasoning documented.
Applied as the per-test timeout to exactly those four tests. The diff is mostly Biome rewrapping the it(...) calls.
Why 30 s: about five times the slowest time measured under load, which leaves room for slower shared CI runners. It is the same value as the repository's integration-test timeout, and still bounded, so an import that genuinely hangs fails.
Unchanged: assertions, coverage, the global Vitest timeout, parallelism and production code. There are no retries.
Verification
Group alone, 5 times: 5/5 tests passed each time.
Same concurrent-load setup, 3 times: Core 1139/1139 passed each time. doctor-import took 5,001 ms and 5,098 ms in runs 2 and 3; both passed now, and both would have failed at the old 5 s limit.
pnpm verify: passed once. Turbo had cached the unchanged packages' test tasks, so Core ran under less contention than a cold run; the load runs above cover the saturated case.
Fixes the recurring 5 s timeouts in Core's import-safety tests during full `pnpm verify`. Tests only.
## Root cause
Four tests prove that importing a module has no side effects:
- `doctor-import`
- `module-http-import`
- `cli-bootstrap-platform-owner`
- `cli-create-initial-owner` (its first test)
Each does a **cold dynamic `import()` of a large Core source graph inside the test body**. Vitest transforms and evaluates that graph on demand, so the CPU-bound cost counts against the default **5 s per-test timeout**. Ordinary test files import at the top level, outside any test timeout.
There is no subprocess, no shared resource and no test bug. The cause is plain CPU contention: under a full `pnpm verify`, Turbo runs every package's suite at once.
Measured on six cores:
| Condition | Duration of these four tests |
| --- | --- |
| Alone | 0.7–1.2 s |
| Core's suite alongside five other packages' suites (api, shell, module-pack, contracts, template), as in `pnpm verify` | **3.0–5.4 s** (`doctor-import` 5,400 ms) |
## Change
- **New:** `core/tests/support/import-safety.ts` exports `IMPORT_SAFETY_TEST_TIMEOUT_MS = 30_000`, with the reasoning documented.
- **Applied** as the per-test timeout to exactly those four tests. The diff is mostly Biome rewrapping the `it(...)` calls.
- **Why 30 s:** about five times the slowest time measured under load, which leaves room for slower shared CI runners. It is the same value as the repository's integration-test timeout, and still bounded, so an import that genuinely hangs fails.
- **Unchanged:** assertions, coverage, the global Vitest timeout, parallelism and production code. There are no retries.
## Verification
- **Group alone, 5 times:** 5/5 tests passed each time.
- **Same concurrent-load setup, 3 times:** Core 1139/1139 passed each time. `doctor-import` took **5,001 ms** and **5,098 ms** in runs 2 and 3; both passed now, and both would have failed at the old 5 s limit.
- **`pnpm verify`:** passed once. Turbo had cached the unchanged packages' test tasks, so Core ran under less contention than a cold run; the load runs above cover the saturated case.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Four Core tests prove that importing a module has no side effects. Each one
does a cold dynamic import() of a large Core source graph inside its test
body:
- doctor-import
- module-http-import
- cli-bootstrap-platform-owner
- cli-create-initial-owner (its first test)
Vitest transforms and evaluates that graph on demand, so the CPU-bound cost
counts against the default 5 s per-test timeout. Ordinary test files import
at the top level, outside any test timeout. There is no subprocess, shared
resource, or test bug.
Measured on six cores:
- alone: 0.7–1.2 s;
- alongside five other packages' suites, as in a full pnpm verify:
3.0–5.4 s (doctor-import reached 5,400 ms).
A shared IMPORT_SAFETY_TEST_TIMEOUT_MS of 30 s (core/tests/support/
import-safety.ts) now applies to exactly these four tests. That is about five
times the slowest time measured under load, the same as the repository's
integration-test timeout, and still bounded, so an import that genuinely
hangs fails. Assertions, coverage, the global Vitest timeout, parallelism,
and production code are unchanged; there are no retries.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes the recurring 5 s timeouts in Core's import-safety tests during full
pnpm verify. Tests only.Root cause
Four tests prove that importing a module has no side effects:
doctor-importmodule-http-importcli-bootstrap-platform-ownercli-create-initial-owner(its first test)Each does a cold dynamic
import()of a large Core source graph inside the test body. Vitest transforms and evaluates that graph on demand, so the CPU-bound cost counts against the default 5 s per-test timeout. Ordinary test files import at the top level, outside any test timeout.There is no subprocess, no shared resource and no test bug. The cause is plain CPU contention: under a full
pnpm verify, Turbo runs every package's suite at once.Measured on six cores:
pnpm verifydoctor-import5,400 ms)Change
core/tests/support/import-safety.tsexportsIMPORT_SAFETY_TEST_TIMEOUT_MS = 30_000, with the reasoning documented.it(...)calls.Verification
doctor-importtook 5,001 ms and 5,098 ms in runs 2 and 3; both passed now, and both would have failed at the old 5 s limit.pnpm verify: passed once. Turbo had cached the unchanged packages' test tasks, so Core ran under less contention than a cold run; the load runs above cover the saturated case.🤖 Generated with Claude Code