Repository navigation
Description
Part of #5755. Design: arch doc §Test plan (branch stateless-transport-proxies-design, PR #5808).
Live, end-to-end tests for dual-era (Legacy 2025-11-25 + Modern 2026-07-28) proxy behavior — runnable locally, in Kubernetes, and in CI. Unit/integration coverage in #5829/#5830/#5831 is necessary but not sufficient: this path is concurrency-sensitive and a confidentiality boundary, so it needs live tests that drive real traffic through the proxies.
Harness / fixtures — division of labor
- go-sdk v1.7, out of process — fidelity legs. A real go-sdk v1.7 client (and/or a
Stateless: truego-sdk backend) drives the functional and dual-era negotiation tiers with real spec behavior; as an independent implementation of the spec it catches misreadings a hand-rolled client would share with the proxy code. Modern traffic requires both peers on v1.7 + stateless (else the SDK negotiates down to 2025-11-25).- Do NOT import go-sdk v1.7 into ToolHive's Go module. ToolHive consumes MCP via toolhive-core's
mcpcompat(pinned go-sdk v1.6.1); a direct test-only import would make MVS bump the whole module to v1.7 and drag the production shim along, forcing Adopt go-sdk v1.7 for MCP 2026-07-28 stateless support #5754 as a side effect. Run the SDK peers as separate binaries (owngo.mod/toolssubmodule, or a container) talking to ToolHive over the wire — exactly how the Add MCP conformance CI job for thv run proxy #5806 conformance job runs its reference server andnpxtool out of process. The e2e test drives ToolHive as a black box.
- Do NOT import go-sdk v1.7 into ToolHive's Go module. ToolHive consumes MCP via toolhive-core's
- Hand-rolled raw HTTP client, in-repo — adversarial/concurrency tier. A conforming SDK won't emit spoofed/foreign
Mcp-Session-Id, colliding JSON-RPC ids, malformed_meta, header/body mismatches, or Modern batches — exactly the traffic the security-critical tests need. Byte-level control, no go-sdk dependency. - Upstream conformance suite — a third fidelity source once a 2026-07-28-capable version exists (deferred).
- Fault-injecting backend: a minimal in-repo backend where a test needs to inject faults or malformed responses.
Test tiers
- Functional: both eras through both proxies — Modern unary round-trips, no
Mcp-Session-Idfor Modern,server/discoverreachable through authz, Legacy unchanged. (go-sdk driver.) - Adversarial + concurrency (security-critical, raw client): cross-delivery stress test (many concurrent clients, colliding JSON-RPC ids, under
-race, looped — no client receives another's response); hostile inputs (foreign session id, spoofed/malformed_meta, header/body mismatch →-32020, unsupported version →-32022, oversized/truncated bodies, batch/client-response smuggling); dual-era concurrent mixing on one backend sharing a session store. - Resilience: no session/goroutine accumulation under sustained Modern load; fault injection (backend crash/restart mid-request, k8s pod eviction, Redis unavailable) — Legacy recovers, Modern degrades cleanly.
Standing gates: Legacy behavior byte-for-byte unchanged and the #5806 conformance job stays green; Modern spans carry per-request mcp.client.name/mcp.protocol.version.
Environments
- Local (
task test-e2e): extendtest/e2e/stateless_proxy_test.go—thv runa stdio backend (streamable proxy) and an HTTP backend (transparent proxy). - Kubernetes (kind + operator): MCPServer CRD, multi-replica streamable-http backend — assert any-pod routing (no pod-pinning/reinit), mixed Legacy+Modern with Redis +
SessionAffinity: None,ping-free health readiness, pod-eviction faults. - CI (
e2e-tests.yml): local e2e per-PR job, k8s e2e kind job; extend Add MCP conformance CI job for thv run proxy #5806 conformance to a Modern/stdio config once a 2026-07-28-capable upstream version exists.
Deferred-streaming tests (land with the streaming work)
Slow-client backpressure (one slow consumer must not stall others), mid-stream disconnect → assert upstream cancellation, and stream/goroutine-leak checks under subscription churn.
Dependencies
Behavior to assert against comes from #5829 (foundation), #5830 (streamable), #5831 (transparent) — the harness/fixtures can scaffold in parallel, but tier assertions land as those implement. Each of #5829/#5830/#5831 also adds its own live-e2e assertion using this harness.
Activity
jhrozek commentedon Jul 22, 2026
Tracking the yardstick-side work this issue calls out (the go-sdk v1.7 out-of-process
fidelity peer and the fault-injecting backend) over in StacklokLabs/yardstick#138:
fault-injection modes (
barrier/hang/crash) onyardstick-server, a go-sdk v1.7.0-pre.3bump for Modern (2026-07-28) support, a
--statelessflag, and matching client/e2ecoverage. Implementation is ready; PR incoming against that issue.
Restore default-off Modern dispatch kill-switch
Restore default-off Modern dispatch kill-switch
Restore default-off Modern dispatch kill-switch
Serve MCP 2026-07-28 Modern stateless requests through vMCP (#5953)
Remove the vMCP Modern dispatch kill-switch
Remove the vMCP Modern dispatch kill-switch
Remove the vMCP Modern dispatch kill-switch
Remove the vMCP Modern dispatch kill-switch
Remove the vMCP Modern dispatch kill-switch
Remove the vMCP Modern dispatch kill-switch