Skip to content

Commit 30c1b03

Browse files
committed
mcp: fix flaky streamable batch test
1 parent 1f25cc9 commit 30c1b03

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mcp/streamable_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,13 +675,14 @@ func TestStreamableServerTransport(t *testing.T) {
675675
headers: http.Header{"MCP-Protocol-Version": {"2025-03-26"}},
676676
// Two messages => batch. Expect OK with two responses in order.
677677
messages: []jsonrpc.Message{
678+
// Note: only include one request here, because responses are not
679+
// necessarily sorted.
678680
req(201, "tools/call", &CallToolParams{Name: "tool"}),
679-
req(202, "tools/call", &CallToolParams{Name: "tool"}),
681+
req(0, "notifications/roots/list_changed", &RootsListChangedParams{}),
680682
},
681683
wantStatusCode: http.StatusOK,
682684
wantMessages: []jsonrpc.Message{
683685
resp(201, &CallToolResult{Content: []Content{}}, nil),
684-
resp(202, &CallToolResult{Content: []Content{}}, nil),
685686
},
686687
},
687688
},

0 commit comments

Comments
 (0)