From ac717a92e8f763867a29249438d89b95d2e018a9 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Thu, 16 Apr 2026 11:35:14 -0700 Subject: [PATCH] test(gateway): avoid mapped hook provenance event race --- src/gateway/server.hooks.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gateway/server.hooks.test.ts b/src/gateway/server.hooks.test.ts index 5f161cc598c..9672922a92b 100644 --- a/src/gateway/server.hooks.test.ts +++ b/src/gateway/server.hooks.test.ts @@ -260,7 +260,9 @@ describe("gateway server hooks", () => { messages: [{ id: "msg-1", from: "Ada", subject: "Hello", snippet: "Hi", body: "Body" }], }); expect(response.status).toBe(200); - await waitForSystemEvent(); + await expect + .poll(() => cronIsolatedRun.mock.calls.length, { timeout: 2_000, interval: 10 }) + .toBe(1); const call = (cronIsolatedRun.mock.calls[0] as unknown[] | undefined)?.[0] as { sessionKey?: string;