Skip to content

Commit a21af1e

Browse files
TMHSDigitalclaude
andcommitted
Check Serve's error in TestGoneClientStopsQueuedCalls (#240)
golangci-lint v2.15.0 (CI's version) flags the error the test received from Serve and dropped (errcheck); the older local copy did not, so CI has been red since 4d5749d. The test now asserts Serve returns context.Canceled after the failed write. Refs #240 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 2ff3029 commit a21af1e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎internal/mcp/mcp_test.go‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"bufio"
55
"context"
66
"encoding/json"
7+
"errors"
78
"io"
89
"strings"
910
"sync/atomic"
@@ -363,7 +364,10 @@ func TestGoneClientStopsQueuedCalls(t *testing.T) {
363364
done := make(chan error, 1)
364365
go func() { done <- (&Server{Tools: []Tool{block}}).Serve(context.Background(), in, brokenWriter{}) }()
365366
select {
366-
case <-done:
367+
case err := <-done:
368+
if !errors.Is(err, context.Canceled) {
369+
t.Errorf("Serve returned %v, want context.Canceled from the failed write", err)
370+
}
367371
case <-time.After(5 * time.Second):
368372
t.Fatal("Serve kept running queued calls after its client was gone")
369373
}

0 commit comments

Comments
 (0)