From bd24d0aa983346b97bf9f9bf99227cd6c7539d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 8 Nov 2026 13:20:54 +0100 Subject: [PATCH] test(integration): keep racing feed rotations until a pair collides Four fixed rounds could all finish one rotation before the other started on a fast runner, so the guard that the race really ran failed with eight 201s. Rounds now continue until a 409 shows up, with the mint bucket emptied between them, and the guard still fails if no pair ever collides. --- tests/integration/cycle-calendar-feed.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/integration/cycle-calendar-feed.test.ts b/tests/integration/cycle-calendar-feed.test.ts index adc7bcf04..257ab7234 100644 --- a/tests/integration/cycle-calendar-feed.test.ts +++ b/tests/integration/cycle-calendar-feed.test.ts @@ -216,9 +216,12 @@ describe("turning the subscription on", () => { const owner = await makeUser("owner"); await mint(owner.id); // Both read the same live feed and revoke it; the second successor then - // meets the one-live-feed index. Four rounds stay inside the mint bucket. + // meets the one-live-feed index. A fast runner can still finish one + // rotation before the other starts, so rounds go on until a pair has + // really collided, with the mint bucket emptied between them. const statuses: number[] = []; - for (let round = 0; round < 4; round++) { + for (let round = 0; round < 25 && !statuses.includes(409); round++) { + await db().rateLimit.deleteMany(); const pair = await Promise.all([rotate(), rotate()]); for (const res of pair) { statuses.push(res.status);