From 17d04bbd303bf92d4a0e4baa05d73b2041e281fb Mon Sep 17 00:00:00 2001 From: Apurv Kumaria Date: Sun, 26 Jul 2026 13:50:49 -0700 Subject: [PATCH 1/2] test(e2e): cover stale receipt page cap Signed-off-by: Apurv Kumaria --- test/pr-e2e-dispatch-reconciliation.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/pr-e2e-dispatch-reconciliation.test.ts b/test/pr-e2e-dispatch-reconciliation.test.ts index 929018f8aa..33099a6fee 100644 --- a/test/pr-e2e-dispatch-reconciliation.test.ts +++ b/test/pr-e2e-dispatch-reconciliation.test.ts @@ -426,6 +426,22 @@ describe("PR E2E workflow dispatch reconciliation", () => { expect(api).toHaveBeenCalledTimes(2); }); + it("accepts a complete stale receipt inventory at GitHub's filtered-result cap", async () => { + const runs = Array.from({ length: 1_000 }, (_value, index) => + unrelatedWorkflowRun(index + 100), + ); + const api = paginatedInventoryApi(runs); + + await expect( + assertDispatchStillNotObserved(oldReceiptOptions(), { + api, + now: () => SENT_AT_MS + WINDOW_MS + 2_000, + clockSkewMs: 10, + }), + ).resolves.toBeUndefined(); + expect(api).toHaveBeenCalledTimes(10); + }); + it("blocks replacement when the old correlation appears after the first inventory page", async () => { const recheckTime = SENT_AT_MS + WINDOW_MS + 2_000; const runs = [ From a828a73db1763095e56bf49dc0470e8cca9d0081 Mon Sep 17 00:00:00 2001 From: Apurv Kumaria Date: Sun, 26 Jul 2026 14:13:19 -0700 Subject: [PATCH 2/2] test(e2e): assert stale receipt page sequence Signed-off-by: Apurv Kumaria --- test/pr-e2e-dispatch-reconciliation.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/pr-e2e-dispatch-reconciliation.test.ts b/test/pr-e2e-dispatch-reconciliation.test.ts index 33099a6fee..9453a51375 100644 --- a/test/pr-e2e-dispatch-reconciliation.test.ts +++ b/test/pr-e2e-dispatch-reconciliation.test.ts @@ -440,6 +440,11 @@ describe("PR E2E workflow dispatch reconciliation", () => { }), ).resolves.toBeUndefined(); expect(api).toHaveBeenCalledTimes(10); + expect( + api.mock.calls.map(([apiPath]) => + Number(new URL(`https://api.github.com/${apiPath}`).searchParams.get("page")), + ), + ).toEqual(Array.from({ length: 10 }, (_value, index) => index + 1)); }); it("blocks replacement when the old correlation appears after the first inventory page", async () => {