Skip to content

CI flake: vitest worker fork exits unexpectedly on windows-latest, failing a fully green suite #159

Description

@debugmcpdev

Symptom

The Build and Test (windows-latest, 22.x, 3.11) job can fail with a fully green test suite. Observed on the main push run for a0e38b3 (run 28960586768):

 Test Files  157 passed | 2 skipped (160)
      Tests  2462 passed | 5 skipped (2505)
     Errors  1 error

The one error is pool-level, reported after the summary:

Error: [vitest-pool]: Worker forks emitted error.
Caused by: Error: Worker exited unexpectedly
 ❯ ChildProcess.emitUnexpectedExit node_modules/.pnpm/vitest@4.1.9_.../vitest/dist/chunks/cli-api.24X8XwN1.js:3023:33

A vitest worker fork died on the Windows runner (timing suggests during teardown of one of the proxy-heavy test files, which log many intentional [Test] UnhandledRejection lines while exercising proxy failure paths). Vitest counts the dead worker as Errors: 1 and exits non-zero even though zero tests failed.

Evidence it's a flake

Why it matters

Same family as the known Windows proxy-init flake (previously hit "Windows Python Integration Focus", also cleared by rerun). Each occurrence costs a manual rerun and undermines trust in red CI on main.

Possible directions

  • Identify which test file's worker dies (vitest logs the pool error without attributing a file; --reporter=verbose on CI or teardown hardening in the proxy-heavy suites may narrow it).
  • Consider whether proxy tests leave child processes/timers alive at worker shutdown on Windows (worker exit code suggests a hard exit rather than a crash-under-test).
  • Escape hatch if attribution stalls: vitest pool options / retry-on-worker-exit behavior, though masking the exit would hide real leaks.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions