Skip to content

host/vitest: migrate off removed test.poolOptions for Vitest 4#826

Closed
brandonpayton wants to merge 1 commit into
mainfrom
gascity/kd-1mr/kd-wgzh-migrate-vitest.config.ts-off-removed-test.pooloptions-fo
Closed

host/vitest: migrate off removed test.poolOptions for Vitest 4#826
brandonpayton wants to merge 1 commit into
mainfrom
gascity/kd-1mr/kd-wgzh-migrate-vitest.config.ts-off-removed-test.pooloptions-fo

Conversation

@brandonpayton

Copy link
Copy Markdown
Member

What

Migrate host/vitest.config.ts off test.poolOptions, which Vitest 4 removed
(the dev shell now installs Vitest 4.1.9). The former poolOptions.forks.maxForks
becomes the top-level maxWorkers; pool: "forks" and teardownTimeout are unchanged.
Stale comments referencing vitest 3.2.4 / a pending 3.2.5+ fix are refreshed.

Before this change every cd host && npx vitest run printed:

 DEPRECATED  `test.poolOptions` was removed in Vitest 4. All previous `poolOptions` are
 now top-level options. … https://vitest.dev/guide/migration#pool-rework

Change

-    poolOptions: {
-      forks: {
-        maxForks: process.env.CI ? 1 : 4,
-      },
-    },
+    maxWorkers: process.env.CI ? 1 : 4,

Behavior is preserved: with pool: "forks", maxWorkers caps the number of worker
forks — 1 on CI (serialized) and 4 locally (parallel), exactly as maxForks did.

Verification (vitest 4.1.9)

  • No deprecation warning after the change, for both CI states — before/after logs in
    test-runs/kd-wgzh/logs/.
  • Behavior preserved — Vitest's own createVitest() resolves the config to
    pool:"forks", maxWorkers:1 under CI=1 and maxWorkers:4 unset
    (test-runs/kd-wgzh/resolved-config.txt).
  • Outcome lists: test-runs/kd-wgzh/outcome-lists/{passed,failed,skipped}-checks.tsv
    (8 passed / 0 failed / 1 skipped).
  • Not run locally: the full cd host && npx vitest run suite — this clean checkout has
    no built wasm sysroot/kernel/release artifacts that global-setup.ts needs (dev-shell
    wasm32posix-cc + wat2wasm + a built musl sysroot). No test case exercises
    poolOptions/maxWorkers beyond config resolution (verified above); CI runs the full
    host suite in the canonical environment. See test-runs/kd-wgzh/DISPOSITION.md.

Scope

host/vitest.config.ts was the only tracked file using the removed poolOptions
(sdk and packages/registry/* vitest configs never set it).

Bead: kd-wgzh

🤖 Generated with Claude Code

Vitest 4.1.9 removed `test.poolOptions` (former pool options are now
top-level), so `cd host && npx vitest run` printed a DEPRECATED warning on
every run. Move `poolOptions.forks.maxForks` to the top-level `maxWorkers`
(https://vitest.dev/guide/migration#pool-rework), keeping `pool: "forks"`
and the CI=1 / local=4 worker cap. Refresh the stale comments that
referenced vitest 3.2.4 and a pending 3.2.5+ fix.

Verified against vitest 4.1.9: no poolOptions deprecation warning (CI and
non-CI) and resolved config is pool=forks with maxWorkers=1 under CI / 4
locally, preserving prior maxForks behavior. Evidence under
test-runs/kd-wgzh/.

Bead: kd-wgzh

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@brandonpayton

Copy link
Copy Markdown
Member Author

Superseded by #907. The Vitest 4 configuration fix is on main through 149fb3f98, reconstructed with the serialized host-test coverage that #907 needed; this PR was not merged verbatim. Its committed test-runs/ evidence is deliberately not carried forward.

@brandonpayton
brandonpayton deleted the gascity/kd-1mr/kd-wgzh-migrate-vitest.config.ts-off-removed-test.pooloptions-fo branch July 13, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant