Skip to content

Commit 50b3337

Browse files
committed
mcp: use "closed session" instead of "closed connection" in unit tests
1 parent 6788e58 commit 50b3337

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

mcp/streamable_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,12 +1431,12 @@ func TestStreamableGET(t *testing.T) {
14311431
// TestStreamableHTTPHandler_OnSessionClose_SessionDeletion tests that the
14321432
// OnSessionClose callback is called when the client closes the session.
14331433
func TestStreamableHTTPHandler_OnSessionClose_SessionDeletion(t *testing.T) {
1434-
var closedConnections []string
1434+
var closedSessions []string
14351435

14361436
server := NewServer(testImpl, nil)
14371437
handler := NewStreamableHTTPHandler(func(req *http.Request) *Server { return server }, &StreamableHTTPOptions{
14381438
OnSessionClose: func(sessionID string) {
1439-
closedConnections = append(closedConnections, sessionID)
1439+
closedSessions = append(closedSessions, sessionID)
14401440
},
14411441
})
14421442

@@ -1458,10 +1458,10 @@ func TestStreamableHTTPHandler_OnSessionClose_SessionDeletion(t *testing.T) {
14581458
t.Fatalf("session.Close() failed: %v", err)
14591459
}
14601460

1461-
if len(closedConnections) != 1 {
1462-
t.Fatalf("got %d connections, want 1", len(closedConnections))
1461+
if len(closedSessions) != 1 {
1462+
t.Fatalf("got %d closed sessions, want 1", len(closedSessions))
14631463
}
1464-
if closedConnections[0] != sessionID {
1465-
t.Fatalf("got session ID %q, want %q", closedConnections[0], sessionID)
1464+
if closedSessions[0] != sessionID {
1465+
t.Fatalf("got session ID %q, want %q", closedSessions[0], sessionID)
14661466
}
14671467
}

0 commit comments

Comments
 (0)