summaryrefslogtreecommitdiff
path: root/internal/mcp/server_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-23 09:04:17 +0200
committerPaul Buetow <paul@buetow.org>2026-03-23 09:04:17 +0200
commit462184dff3eef32f01f06634305da1355ac1bec2 (patch)
tree026ffaaeacfe152957298c985e1df77ff661b723 /internal/mcp/server_test.go
parent667f2d3384643aa877de2eefcbad3923965bad09 (diff)
chore: bump version to v0.25.9v0.25.9
Code quality fixes from audit: - Log silently discarded errors in status sinks and stats.Update call sites - Fix json.Marshal errors silently ignored in LSP handlers - Replace time.Sleep in tests with channel signaling (mcp) and fake clock (stats) - Make context cancellation work in production time.Sleep sites (handlers_document, cmdentry) - Remove init()-based provider registration from llm package; use explicit RegisterAllProviders() - Add WaitGroup goroutine tracking to MCP server Run() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/mcp/server_test.go')
-rw-r--r--internal/mcp/server_test.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/mcp/server_test.go b/internal/mcp/server_test.go
index 256b324..00a7823 100644
--- a/internal/mcp/server_test.go
+++ b/internal/mcp/server_test.go
@@ -430,14 +430,17 @@ func TestServer_Run(t *testing.T) {
t.Fatalf("sendRequest() error = %v", err)
}
- // Run in background
+ // Run in background; bytes.Buffer returns EOF after the single request,
+ // so Run() will complete naturally once it has written the response.
done := make(chan error, 1)
go func() {
done <- server.Run()
}()
- // Give time for processing (server will block waiting for more input)
- time.Sleep(50 * time.Millisecond)
+ // Wait for Run() to return (signalled by EOF on the input buffer).
+ if err := <-done; err != nil {
+ t.Fatalf("Run() error = %v", err)
+ }
// Read response
resp, err := readResponse(outBuf)