Skip to content

Commit c5c3556

Browse files
committed
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.
1 parent a3b9e74 commit c5c3556

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

e2e-cli/src/cli.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ interface CLIConfig {
4646
flushAt?: number;
4747
flushInterval?: number;
4848
maxRetries?: number;
49+
timeout?: number;
4950
}
5051

5152
interface CLIInput {
@@ -229,7 +230,8 @@ async function main() {
229230
}
230231

231232
await client.flush();
232-
const drained = await waitForQueueDrain(client);
233+
const drainTimeoutMs = (input.config?.timeout ?? 120) * 1000;
234+
const drained = await waitForQueueDrain(client, drainTimeoutMs);
233235

234236
const finalPending = drained ? 0 : await client.pendingEvents();
235237
const totalEvents = input.sequences.reduce(

0 commit comments

Comments
 (0)