Skip to content

Commit b512583

Browse files
d-csclaude
andcommitted
test(redis-worker): allow timer jitter in mollifier drainer stop-timeout test
Node's setTimeout can fire a millisecond or two early under CI load, causing the existing `>= 500ms` lower bound to flake (saw 499ms in CI). Loosen to `>= 450ms` — the behaviour being pinned is "stop honors the deadline instead of waiting for the hung handler indefinitely", not millisecond-precise timing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b96bae2 commit b512583

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/redis-worker/src/mollifier/drainer.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,11 @@ describe("MollifierDrainer.start/stop", () => {
12431243
await drainer.stop({ timeoutMs: 500 });
12441244
const stopElapsed = Date.now() - stopStart;
12451245

1246-
expect(stopElapsed).toBeGreaterThanOrEqual(500);
1246+
// Allow a small jitter window below `timeoutMs` — Node's setTimeout can
1247+
// fire a millisecond or two early under CI load. The behaviour we're
1248+
// pinning is "stop honors the deadline instead of waiting for the hung
1249+
// handler indefinitely", not millisecond-precise timing.
1250+
expect(stopElapsed).toBeGreaterThanOrEqual(450);
12471251
expect(stopElapsed).toBeLessThan(2_000);
12481252
} finally {
12491253
await buffer.close();

0 commit comments

Comments
 (0)