all: minor cleanup (#545)

Also fix a flaky test case in TestStreamableServerTransport.
This commit is contained in:
Robert Findley 2025-09-30 15:53:00 -04:00 • committed by GitHub
commit 6dbf6c6450
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -675,13 +675,14 @@ func TestStreamableServerTransport(t *testing.T) {
headers: http.Header{"MCP-Protocol-Version": {"2025-03-26"}},
// Two messages => batch. Expect OK with two responses in order.
messages: []jsonrpc.Message{
// Note: only include one request here, because responses are not
// necessarily sorted.
req(201, "tools/call", &CallToolParams{Name: "tool"}),
req(202, "tools/call", &CallToolParams{Name: "tool"}),
req(0, "notifications/roots/list_changed", &RootsListChangedParams{}),
},
wantStatusCode: http.StatusOK,
wantMessages: []jsonrpc.Message{
resp(201, &CallToolResult{Content: []Content{}}, nil),
resp(202, &CallToolResult{Content: []Content{}}, nil),
},
},
},