From 580e7c33f298bc473c455ceff171d7cf94b60264 Mon Sep 17 00:00:00 2001 From: tt-a1i Date: Sat, 5 Sep 2026 11:15:26 +0800 Subject: [PATCH] fix(test): give stalled Antigravity body failover a 500ms budget The 50ms timeout was too tight on loaded CI: first-body stall and the follow-up request shared a wall-clock window that production resets per endpoint. Widen only this test; keep the hung 503 body. --- tests/extensions/ai-providers/antigravity.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/extensions/ai-providers/antigravity.test.ts b/tests/extensions/ai-providers/antigravity.test.ts index c05b8cad..ea83c49c 100644 --- a/tests/extensions/ai-providers/antigravity.test.ts +++ b/tests/extensions/ai-providers/antigravity.test.ts @@ -940,6 +940,8 @@ test("streamAntigravity fails over to the sandbox endpoint on 5xx", async () => }); test("streamAntigravity bounds a stalled non-2xx body and fails over", async () => { + const stalledBodyTimeoutMs = 500; + const stalledBodyOuterMs = 2 * stalledBodyTimeoutMs + 500; let requests = 0; const server = http.createServer((_request, response) => { requests++; @@ -966,7 +968,7 @@ test("streamAntigravity bounds a stalled non-2xx body and fails over", async () events = await collectEvents( streamAntigravity(GEMINI_MODEL, SIMPLE_CONTEXT, { apiKey: API_KEY, - timeoutMs: 50, + timeoutMs: stalledBodyTimeoutMs, fetch: (_input, init) => originalFetch(localUrl, init), }), ); @@ -974,7 +976,7 @@ test("streamAntigravity bounds a stalled non-2xx body and fails over", async () server.closeAllConnections(); await new Promise((resolve) => server.close(() => resolve())); } - assert.ok(Date.now() - startedAt < 1_000); + assert.ok(Date.now() - startedAt < stalledBodyOuterMs); assert.equal(requests, 2); const done = events.find((event) => event.type === "done"); assert.ok(done && done.type === "done" && done.reason === "stop");