From ecfe3ad1300e4b97e2dc56b1381575d7546c0a84 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 28 Sep 2026 14:04:38 -0700 Subject: [PATCH] test(smoketests): log why concurrent HTTP/2 requests were rejected The HTTP/2 verification counted rejected concurrent requests without saying why, so a failure like "25 concurrent requests all resolved (19/25)" gave no clue whether it was rate limiting, a stream error or something else. Each distinct rejection reason (error type, HTTP status, error code, message) is now printed once with a count. Co-Authored-By: Claude Opus 5.5 (1M context) --- tests/smoketests/scripts/verify-http2.mjs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/smoketests/scripts/verify-http2.mjs b/tests/smoketests/scripts/verify-http2.mjs index c52308a17..0038269c4 100644 --- a/tests/smoketests/scripts/verify-http2.mjs +++ b/tests/smoketests/scripts/verify-http2.mjs @@ -93,10 +93,23 @@ try { const N = 25; const before = connectCount; const client = newClient({ http2: true }); - const results = await Promise.allSettled(Array.from({ length: N }, () => client.devboxes.list({ limit: 1 }))); + const results = await Promise.allSettled( + Array.from({ length: N }, () => client.devboxes.list({ limit: 1 })), + ); const ok = results.filter((r) => r.status === 'fulfilled').length; const opened = connectCount - before; check(ok === N, `h2: ${N} concurrent requests all resolved (${ok}/${N})`); + // Print why requests were rejected, once per distinct reason, so a failure explains itself. + const reasons = new Map(); + for (const r of results) { + if (r.status !== 'rejected') continue; + const e = r.reason; + const reason = [e?.constructor?.name, e?.status, e?.code ?? e?.cause?.code, e?.message ?? String(e)] + .filter((part) => part != null) + .join(' '); + reasons.set(reason, (reasons.get(reason) ?? 0) + 1); + } + for (const [reason, count] of reasons) console.log(` rejected x${count}: ${reason}`); check(opened <= 4, `h2: ${N} concurrent requests multiplexed over <= 4 connections (opened ${opened})`); } catch (e) { check(false, `h2: concurrent multiplexing pass threw ${e?.constructor?.name}: ${e?.message}`);