From d558b1017db83306b5b373b29cb94c4651c6eda7 Mon Sep 17 00:00:00 2001 From: Jarvis Date: Thu, 11 Jun 2026 16:04:40 +0800 Subject: [PATCH] fix(e2e): audio/images propagation predicates tolerate transport failures waitConfigPropagation polled with a bare fetch: a connection the DP drops mid-write while the route is still propagating (EPIPE) threw out of the predicate and failed the spec. Wrap in try/catch -> false, the same contract every other spec's predicate uses. --- .../src/cases/audio-images-usage-e2e.test.ts | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tests/e2e/src/cases/audio-images-usage-e2e.test.ts b/tests/e2e/src/cases/audio-images-usage-e2e.test.ts index 397b4aaa..c158f8b1 100644 --- a/tests/e2e/src/cases/audio-images-usage-e2e.test.ts +++ b/tests/e2e/src/cases/audio-images-usage-e2e.test.ts @@ -81,7 +81,16 @@ describe("audio + images UsageEvent emission (#406/#407)", () => { }, body: JSON.stringify({ model: "img-usage", prompt: "a cat", n: 1 }), }); - await waitConfigPropagation(async () => (await call()).ok); + await waitConfigPropagation(async () => { + // The DP may drop the connection mid-write (EPIPE) while the + // route is still propagating — treat transport failures as + // "not ready yet", like every other spec's predicate does. + try { + return (await call()).ok; + } catch { + return false; + } + }); expect((await call()).status).toBe(200); const emitted = await pollUsageEmitted(app.adminUrl, "images"); @@ -132,7 +141,16 @@ describe("audio + images UsageEvent emission (#406/#407)", () => { body: form, }); }; - await waitConfigPropagation(async () => (await call()).ok); + await waitConfigPropagation(async () => { + // The DP may drop the connection mid-write (EPIPE) while the + // route is still propagating — treat transport failures as + // "not ready yet", like every other spec's predicate does. + try { + return (await call()).ok; + } catch { + return false; + } + }); expect((await call()).status).toBe(200); const emitted = await pollUsageEmitted(app.adminUrl, "audio");