Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions test/pr-e2e-dispatch-reconciliation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,27 @@ 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);
Comment thread
coderabbitai[bot] marked this conversation as resolved.
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 () => {
const recheckTime = SENT_AT_MS + WINDOW_MS + 2_000;
const runs = [
Expand Down
Loading