From 2dc55361e03d4e6852dcdd1cbae4098442683f34 Mon Sep 17 00:00:00 2001 From: ozz Date: Thu, 23 Jul 2026 12:48:07 +0000 Subject: [PATCH] Deflake vMCP forwarding notification wait TestForwarding_Progress_RealBackend (and its sibling forwarding tests) flaked on CI: waitNotification used a hardcoded 5s deadline for an async, server-initiated notification relayed backend -> vMCP -> downstream. Under the full-suite parallel -race load the round trip exceeds 5s and the test times out, while it passes in milliseconds locally. Raise the wait deadline to 15s, leaving headroom under the callers' 20s context so a genuine hang still fails cleanly instead of blocking to the context deadline. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../server/forwarding_realbackend_integration_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/vmcp/server/forwarding_realbackend_integration_test.go b/pkg/vmcp/server/forwarding_realbackend_integration_test.go index a96bb777a9..a9429dd78e 100644 --- a/pkg/vmcp/server/forwarding_realbackend_integration_test.go +++ b/pkg/vmcp/server/forwarding_realbackend_integration_test.go @@ -205,7 +205,13 @@ func newDownstreamClient(ctx context.Context, t *testing.T, vmcpURL string, with // waitNotification blocks for a forwarded notification with the given method. func (dc *downstreamClient) waitNotification(t *testing.T, method string) mcpmcp.JSONRPCNotification { t.Helper() - deadline := time.After(5 * time.Second) + // Give the forwarded notification generous headroom: these are async, + // server-initiated messages relayed backend -> vMCP -> downstream, and under + // the full-suite parallel `-race` load on CI the round trip can take well over + // a second. The previous 5s deadline flaked (timed out) there while passing in + // milliseconds locally. Stay under the callers' 20s context so a genuine hang + // still fails cleanly rather than blocking to the context deadline. + deadline := time.After(15 * time.Second) for { select { case n := <-dc.notifCh: