Fix failing e2e tests: client-credentials Windows crash + stdio server startup#285
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the e2e failures seen across the Windows/Bun CI runs — three distinct issues:
process.exit()on a login failure raced libuv's handle teardown and aborted with an async-handle assertion, corrupting--jsonoutput. Setprocess.exitCodeand 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.npx -y @modelcontextprotocol/server-filesystemintermittently installed an incomplete dep tree (missing transitiveajv), crashing every stdio test. Pin it as a devDependency and launch it directly with node.sleep 1raced 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