From c5c3556c1af6ca0c4567ae4fcbb3801e7e04540b Mon Sep 17 00:00:00 2001 From: Michael Grosse Huelsewiesche Date: Fri, 24 Apr 2026 16:33:41 -0400 Subject: [PATCH] fix(e2e-cli): use config timeout for queue drain wait The CLI was using a hardcoded 30s timeout for waitForQueueDrain, which is shorter than a single Retry-After: 60 cycle. Events rate-limited near the end of a test run would be dropped because the process exited before the retry fired. Now uses config.timeout (default 120s) so the drain wait accommodates at least one full retry cycle. --- e2e-cli/src/cli.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/e2e-cli/src/cli.ts b/e2e-cli/src/cli.ts index 71b84f178..47fd501d8 100644 --- a/e2e-cli/src/cli.ts +++ b/e2e-cli/src/cli.ts @@ -46,6 +46,7 @@ interface CLIConfig { flushAt?: number; flushInterval?: number; maxRetries?: number; + timeout?: number; } interface CLIInput { @@ -229,7 +230,8 @@ async function main() { } await client.flush(); - const drained = await waitForQueueDrain(client); + const drainTimeoutMs = (input.config?.timeout ?? 120) * 1000; + const drained = await waitForQueueDrain(client, drainTimeoutMs); const finalPending = drained ? 0 : await client.pendingEvents(); const totalEvents = input.sequences.reduce(