From 0329412af20a06ff0c5e990fd4ed300655de8acd Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 22 Mar 2026 12:36:14 -0700 Subject: [PATCH] docs: note extension vitest threads default --- docs/help/testing.md | 5 ++++- docs/reference/test.md | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/help/testing.md b/docs/help/testing.md index b2b01ac2f7d..d7fb4b03b3b 100644 --- a/docs/help/testing.md +++ b/docs/help/testing.md @@ -55,6 +55,7 @@ Think of the suites as “increasing realism” (and increasing flakiness/cost): - Scheduler note: - `pnpm test` now keeps a small checked-in behavioral manifest for true pool/isolation overrides and a separate timing snapshot for the slowest unit files. - Shared unit coverage now defaults to `threads`, while the manifest keeps the measured fork-only exceptions and heavy singleton lanes explicit. + - The extension suite (`vitest.extensions.config.ts`) also now defaults to `threads`; the March 22, 2026 direct full-suite control run passed clean without extension-specific fork exceptions. - The wrapper peels the heaviest measured files into dedicated lanes instead of relying on a growing hand-maintained exclusion list. - Refresh the timing snapshot with `pnpm test:perf:update-timings` after major suite shape changes. - Embedded runner note: @@ -69,7 +70,9 @@ Think of the suites as “increasing realism” (and increasing flakiness/cost): through the real `run.ts` / `compact.ts` paths; helper-only tests are not a sufficient substitute for those integration paths. - Pool note: - - OpenClaw uses Vitest `forks` by default for unit shards. + - Base Vitest config still defaults to `forks`. + - Unit wrapper lanes default to `threads`, with explicit manifest fork/vmFork exceptions. + - Extension scoped config defaults to `threads`. - `pnpm test` also defaults to `--isolate=false` at the wrapper level for faster file startup. - Opt back into Vitest file isolation with `OPENCLAW_TEST_ISOLATE=1 pnpm test`. - `OPENCLAW_TEST_NO_ISOLATE=0` or `OPENCLAW_TEST_NO_ISOLATE=false` also force isolated runs. diff --git a/docs/reference/test.md b/docs/reference/test.md index 82e89653812..363dbe4fb13 100644 --- a/docs/reference/test.md +++ b/docs/reference/test.md @@ -14,6 +14,7 @@ title: "Tests" - `pnpm test` on Node 22, 23, and 24 uses Vitest `vmForks` by default for local runs with enough memory. CI stays on `forks` unless explicitly overridden. Node 25+ falls back to `forks` until re-validated. You can force behavior with `OPENCLAW_TEST_VM_FORKS=0|1`. - `pnpm test`: runs the full wrapper. It keeps only a small behavioral override manifest in git, then uses a checked-in timing snapshot to peel the heaviest measured unit files into dedicated lanes. - Unit files default to `threads` in the wrapper; keep fork-only or singleton exceptions documented in `test/fixtures/test-parallel.behavior.json`. +- `pnpm test:extensions` now defaults to `threads` via `vitest.extensions.config.ts`; the March 22, 2026 direct full-suite control run passed clean without extension-specific fork exceptions. - Files marked `singletonIsolated` no longer spawn one fresh Vitest process each by default. The wrapper batches them into dedicated `forks` lanes with `maxWorkers=1`, which preserves isolation from `unit-fast` while cutting process startup overhead. Tune lane count with `OPENCLAW_TEST_SINGLETON_ISOLATED_LANES=`. - `pnpm test:channels`: runs channel-heavy suites. - `pnpm test:extensions`: runs extension/plugin suites.