Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

test(replay): stop the sliding-TTL budget test racing a 5 ms expiry (#1317)

Goldflagfb2a1c663a22
diff --git a/server/src/db/redis/replayBudget.integration.test.ts b/server/src/db/redis/replayBudget.integration.test.ts
index 910972e34..599b3b4cc 100644
--- a/server/src/db/redis/replayBudget.integration.test.ts
+++ b/server/src/db/redis/replayBudget.integration.test.ts
@@ -45,8 +45,10 @@ describe("replayBudgetCharge Lua script", () => {
it("slides the TTL on refused batches too", async () => {
await charge(CAP);
- await redis.pexpire(KEY, 5);
+ // Short enough to tell a slid TTL from the original, long enough that the
+ // key can't expire before the refused charge runs on a slow CI runner.
+ await redis.pexpire(KEY, 5_000);
expect(await charge(10)).toEqual([0, CAP]);
- expect(await redis.pttl(KEY)).toBeGreaterThan(5);
+ expect(await redis.pttl(KEY)).toBeGreaterThan(5_000);
});
});