Repository navigation
Closed
Labels
needs-triageIssue needs initial triage by a maintainer
Description
Why
stacklok/toolhive#5837 needs live e2e tests for dual-era MCP proxy behavior: Legacy
(2025-11-25, session-based, Mcp-Session-Id) and Modern (2026-07-28, stateless,
per-request _meta), plus concurrency/fault-injection coverage for a
confidentiality-sensitive code path. Rather than growing bespoke test infrastructure
in the ToolHive repo, this pushes the reusable capability into yardstick — the shared
in-house MCP test tool — so ToolHive can drive both eras, and inject faults, through it
directly.
What this adds
- Fault-injection modes (
BACKEND_MODE=echo|barrier|hang|crashonyardstick-server,
plusBARRIER_N/HANG_AFTER_N/CRASH_AFTER_N/BARRIER_TIMEOUT_SECONDS): a shared
AddReceivingMiddlewarehook makes the server a controllable backend — buffer N
requests and release together (barrier, for testing response cross-delivery /
confidentiality under concurrency), stop responding after N (hang), or exit non-zero
after N (crash) — uniformly across stdio/SSE/streamable-http. Lifecycle traffic
(initialize,ping,server/discover,notifications/initialized) is exempted so
the fault fires on the Nth real backend call, not during connection setup. - Modern (2026-07-28) support: go-sdk bumped to
v1.7.0-pre.3(no stablev1.7.0tag
exists yet — flagged as an open question below), a--statelessflag/STATELESSenv
var wiringStreamableHTTPOptions.Statelessfor the streamable-http transport, and
yardstick-clientnow reports the negotiated protocol version and correctly skips
Pingwhen talking to a Modern session (go-sdk's server rejectspingunder the new
protocol's per-request_meta). - e2e coverage:
test/integration-test.sh(the project's real black-box e2e script,
already a required CI gate viatask test-integration) got four new blocks — barrier,
hang, crash, stateless — matching the existing per-transport block conventions exactly,
so every new capability has the same real-container, real-binary check every prior
capability already gets.
Open questions carried over from design
- Willing to take the go-sdk
v1.7.0-pre.3pre-release now, or wait for a stable
v1.7.0tag? It's isolated to its own commit so re-pinning later is a one-line change. - Preferred config surface going forward: the fault-injection knobs are intentionally
env-only (no flags) since they need to work identically throughthv run -e, an
MCPServer CRD's env, and plain k8s pod env — is that the right call long-term, or
should there also be flag equivalents? - Release cadence / image tagging: ToolHive would pin a yardstick image tag once this
lands — how fast can a new tag ship if a future test needs a new mode? barriermode is per-process, so it can't fill across k8s replicas — ToolHive's
multi-replica step should useecho, notbarrier, for that scenario.
PR incoming with the full implementation.
Metadata
Metadata
Assignees
Labels
needs-triageIssue needs initial triage by a maintainer
Activity