From ba419554f9c9c5892e1f176e82a78be40ed9e353 Mon Sep 17 00:00:00 2001 From: Aleksandar Grbic Date: Tue, 15 Sep 2026 10:15:50 +0200 Subject: [PATCH] test(api): do not probe an ambient server during verification runs tests/health.test.ts fetches whatever listens on 127.0.0.1:7330. Inside agent:verify that is the developer's dev stack, not the checkout under test, and a bind-mounted dev server restarts on file changes, which turned the probe into a closed-socket failure during a sharded run. Skip it when AGENT_SANDBOX is set; the in-process route tests cover /health. --- apps/api/tests/health.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/api/tests/health.test.ts b/apps/api/tests/health.test.ts index a46b5d79..8a1528a0 100644 --- a/apps/api/tests/health.test.ts +++ b/apps/api/tests/health.test.ts @@ -27,6 +27,16 @@ const isApiReachable = async (): Promise => { }; test("GET /health returns status ok", async () => { + /* + * Verification runs own their API through the browser lane and never + * trust an ambient server. Whatever listens on 7330 during such a run is + * the developer's stack, which restarts on file changes and turns this + * probe into a socket flake; the in-process route tests cover /health. + */ + if (process.env.AGENT_SANDBOX === "1") { + return; + } + if (!(await isApiReachable())) { /* * Integration test: silently passes when the dev server isn't running