Fix streamable HTTP SSE tests for Node v26.7.0+ (Fixes #2661) - #2707
Open
mukktinaadh wants to merge 1 commit into
Open
Fix streamable HTTP SSE tests for Node v26.7.0+ (Fixes #2661)#2707mukktinaadh wants to merge 1 commit into
mukktinaadh wants to merge 1 commit into
Conversation
…otocol#2661) - Update batch request SSE test to read until all responses received - Update notification replay test to read until expected notifications received - Both tests now handle Node v26.7.0+ where SSE events may arrive in separate chunks Fixes modelcontextprotocol#2661
|
@modelcontextprotocol/client
@modelcontextprotocol/codemod
@modelcontextprotocol/core
@modelcontextprotocol/server
@modelcontextprotocol/server-legacy
@modelcontextprotocol/express
@modelcontextprotocol/fastify
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
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.
Summary
This PR fixes the streamable HTTP SSE tests that were failing on Node v26.7.0+.
Problem
On Node v26.7.0+, the
fetchAPI can deliver SSE events in separate chunks rather than delivering multiple SSE events in a single chunk. The existing tests assumed that multiple SSE events would arrive in a singlereader.read()call, causing them to fail when events were split across multiple chunks.Changes
Batch request SSE test (
should handle batch request messages with SSE stream for responses): Updated to read from the SSE stream in a loop until all expected responses are received or a timeout occurs.Notification replay test (
should store and replay MCP server tool notifications): Updated both the initial read and the reconnect read to keep reading until the expected notifications are received.Testing
Related Issues
Fixes #2661