Skip to content

Open-source status page, incident response and uptime monitoring

fix(workflows): make outbox dead-letter test deterministic under parallel load (#2688)

polylane[bot]171a2a94c30c
diff --git a/apps/workflows/src/checker/outbox.test.ts b/apps/workflows/src/checker/outbox.test.ts
index 626d6a09d..b9cce995d 100644
--- a/apps/workflows/src/checker/outbox.test.ts
+++ b/apps/workflows/src/checker/outbox.test.ts
@@ -155,9 +155,13 @@ describe("drainOutbox", () => {
Promise.reject(new Error("provider down")),
),
);
+ // `attempts` caps the backoff (>=15s), so the failed send's retry lands
+ // past the deadline below without the claim racing a 1s deadline under
+ // parallel test load.
await insertOutboxRow({
cronTimestamp: Date.now(),
- deadlineOffsetSeconds: 1,
+ attempts: 10,
+ deadlineOffsetSeconds: 10,
});
const summary = await drainOutbox({
@@ -194,7 +198,8 @@ describe("drainOutbox", () => {
);
await insertOutboxRow({
cronTimestamp: Date.now(),
- deadlineOffsetSeconds: 1,
+ attempts: 10,
+ deadlineOffsetSeconds: 10,
});
const started = Date.now();