Skip to content

Fix failing e2e tests: client-credentials Windows crash + stdio server startup#285

Merged
jancurn merged 1 commit into
mainfrom
claude/magical-hawking-9swiw9
Jun 22, 2026
Merged

Fix failing e2e tests: client-credentials Windows crash + stdio server startup#285
jancurn merged 1 commit into
mainfrom
claude/magical-hawking-9swiw9

Conversation

@jancurn

@jancurn jancurn commented Jun 22, 2026

Copy link
Copy Markdown
Member

Fixes the e2e failures seen across the Windows/Bun CI runs — three distinct issues:

  • client-credentials crash (Windows): the forced process.exit() on a login failure raced libuv's handle teardown and aborted with an async-handle assertion, corrupting --json output. Set process.exitCode and let the event loop drain (the clean teardown the success path already uses); also report the OAuth code (e.g. invalid_client) instead of an empty reason.
  • stdio server startup: npx -y @modelcontextprotocol/server-filesystem intermittently installed an incomplete dep tree (missing transitive ajv), crashing every stdio test. Pin it as a devDependency and launch it directly with node.
  • bridge kill timing: the bridge's graceful SIGTERM shutdown can take ~1-2s, so a fixed sleep 1 raced on Linux/macOS (Windows force-kills). Poll for exit instead (stdio/bridge-restart, sessions/failover).

Full e2e suite now 47/47 locally on both Node and Bun.

Refs #282

https://claude.ai/code/session_01QRAGQAnBzFubSVw2dRiZrV

The Windows libuv async-handle assertion persisted because the forced
process.exit(4) itself races libuv's handle teardown — draining undici's
pool first was not enough. The success path never crashes precisely
because it returns and lets the event loop exit on its own. Mirror that:
on a login failure, set process.exitCode and return instead of
process.exit(). closeProxy() still runs first so idle keep-alive sockets
are closed and the process exits promptly (verified on Node and Bun).

Refs #282

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QRAGQAnBzFubSVw2dRiZrV
@jancurn jancurn merged commit 5e2a8d1 into main Jun 22, 2026
6 checks passed
@jancurn jancurn deleted the claude/magical-hawking-9swiw9 branch June 22, 2026 20:48
@jancurn jancurn changed the title Fix Windows exit crash on client-credentials login failure Fix failing e2e tests: client-credentials Windows crash + stdio server startup Jun 23, 2026
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.

3 participants