• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 23959989489

03 Apr 2026 07:52PM UTC coverage: 65.167% (+0.01%) from 65.153%
23959989489

push

github

web-flow
Fix flaky VirtualMCPServer scaling e2e test (#4524)

The Horizontal Scaling test intermittently timed out waiting for the
VirtualMCPServer to become Ready because the health monitor permanently
reported the backend as unhealthy with "server returned 4xx for
initialize POST".

Root cause: two bugs working together.

1. Wrong localhost fallback in K8s backend discovery. When the MCPServer
   Status.URL hadn't been set yet by the operator (race during startup),
   mcpServerToBackend fell back to http://127.0.0.1:8080/mcp. Inside a
   K8s pod, that hits the vMCP's own metrics server on port 8080, which
   returns 4xx to MCP POST requests.

2. Stale backend in health monitor. UpdateBackends only handled
   adding/removing backends by ID. When the reconciler later updated the
   registry with the correct service URL, the health check goroutine
   kept using the captured stale localhost pointer.

Fix: remove the localhost fallback for both MCPServer and
MCPRemoteProxy — if Status.URL is empty the backend is skipped and the
reconciler adds it once the URL is set. Also teach UpdateBackends to
restart goroutines when a backend's URL or transport type changes.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

33 of 33 new or added lines in 2 files covered. (100.0%)

21 existing lines in 6 files now uncovered.

54590 of 83770 relevant lines covered (65.17%)

63.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

79.38
/pkg/transport/proxy/httpsse/http_proxy.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc