test(gateway): avoid mapped hook provenance event race

This commit is contained in:
Vincent Koc
2026-04-16 11:35:14 -07:00
parent c2db918c60
commit ac717a92e8

View File

@@ -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;