From 8d467b10a4ea928ab39be16fadade260a0138e38 Mon Sep 17 00:00:00 2001 From: mubashir1osmani Date: Mon, 10 Aug 2026 22:50:51 -0700 Subject: [PATCH] fix(e2e/mcp): settle propagation after MCP server registration await_registered only proved one replica had synced the row; on the two-replica stack a tools/call could land on the other pod and 404 with server_not_found. Mirror the model path: poll, then wait out the propagation budget from the moment registration returned. --- tests/e2e/mcp/mcp_client.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/e2e/mcp/mcp_client.py b/tests/e2e/mcp/mcp_client.py index 9a4986b6d44..873e14667db 100644 --- a/tests/e2e/mcp/mcp_client.py +++ b/tests/e2e/mcp/mcp_client.py @@ -275,17 +275,22 @@ class McpClient: ).root def await_registered(self, server_id: str) -> None: - """Poll /v1/mcp/server until `server_id` is listed. Fails at poll_timeout. + """Poll /v1/mcp/server until `server_id` is listed, then wait out the + propagation budget. Fails at poll_timeout. The DB row exists the moment registration returns, but a data-plane pod answers the listing from a registry it refreshes on a periodic DB sync, so a pod that joined the load balancer after the write reports the server as - absent until its first sync. + absent until its first sync. The poll only proves ONE replica has the row; + settle_propagation is what makes the server safe to call on whichever + replica the next request lands on (mirrors ProxyClient.create_model). """ - deadline = time.monotonic() + self.proxy.poll_timeout + written_at = time.monotonic() + deadline = written_at + self.proxy.poll_timeout while True: registered = frozenset(row.server_id for row in self.registered_servers()) if server_id in registered: + settle_propagation(written_at) return if time.monotonic() >= deadline: raise AssertionError(