Skip to content

CLI vitest suite on Windows: one worker fork crashes at teardown in every full run, failing validate:cli with all 304 tests passing #1941

Description

@olaservo

Version: v2 (main, reproduced at 07a2b4b)
Affected client: clients/cli (test infrastructure; Windows only)

Symptom

Every full npm run test in clients/cli on Windows 11 ends with:

⎯⎯ Unhandled Error ⎯⎯
Error: [vitest-pool]: Worker forks emitted error.
Caused by: Error: Worker exited unexpectedly
 Test Files  24 passed (25)
      Tests  303 passed (304)
     Errors  1 error

All tests pass — one worker fork exits with an unexpected code at teardown, vitest counts it as an unhandled error, and the run exits 1. This fails validate:cli → root validatenpm run ci on Windows even on a clean tree.

What's known

  • Deterministic in full-suite runs (4/4 reproduced), including with the JSON reporter (which then shows 108 suites, 106 passed, 0 failed — no suite actually fails).
  • Does not reproduce running suspect files in isolation: e2e, cliOAuth, oauth-runner, oauth-interactive, cli-oauth-navigation, stored-auth each pass cleanly alone — it needs the parallel fork pool under load.
  • Pre-exists unrelated work: reproduced identically on the upstream tip with no local changes.
  • Linux CI is green, so it's Windows-specific (or at least Windows-manifested).

Impact

Windows contributors cannot get a passing npm run validate / npm run ci even when every test passes — together with #1939 this makes the mandatory pre-push gate unrunnable on Windows.

Context

Found while validating the fix for #1852 on a Windows machine.

Metadata

Metadata

Assignees

Labels

v2Issues and PRs for v2

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions