From d67e7c854258ac543af8db80b593439959be2264 Mon Sep 17 00:00:00 2001 From: frstrtr Date: Fri, 19 Jun 2026 19:16:22 +0000 Subject: [PATCH] web-static: de-flake Middleware chain error-taxonomy test (2s Retry-After sleep) The error-taxonomy normalisation test threw a 429 with retryAfter:2000 and left core.transport.retry enabled with maxAttempts:1. retry.ts honours the server Retry-After via Math.max(delay, retryAfterMs), so the single retry slept the full 2000ms before the terminal throw, parking the test on the CI per-test deadline (deterministic, survives re-run). The test subject is error normalisation, not retry; disable core.transport.retry so the normalised rate_limited error (retryAfterMs:2000 still asserted) propagates in ~ms. Product retry behaviour is unchanged. --- .../sharechain-explorer/tests/unit/smoke.test.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/web-static/sharechain-explorer/tests/unit/smoke.test.ts b/web-static/sharechain-explorer/tests/unit/smoke.test.ts index 9151606c3..601ba49a4 100644 --- a/web-static/sharechain-explorer/tests/unit/smoke.test.ts +++ b/web-static/sharechain-explorer/tests/unit/smoke.test.ts @@ -141,13 +141,18 @@ test('Middleware chain: error-taxonomy normalises thrown errors', async () => { ...mockTransport(), fetchWindow: async () => { throw { status: 429, retryAfter: 2000 }; }, }; - // Bound retries and skip timeout so this test fences in ~ms, not the - // D7 unbounded production default. + // This test's subject is error-taxonomy normalisation, not retry/timeout. + // Disable both transport retry and timeout so the normalised error + // propagates immediately. (With retry enabled, the chain honours the + // server-supplied Retry-After of 2000ms — Math.max(delay, retryAfterMs) + // in retry.ts — and sleeps the full 2s before the final throw, pushing + // this test onto the CI per-test deadline. maxAttempts:1 still performs + // one retry, so it does not avoid the sleep.) await host.init({ kind: 'shared-core', transport: angryTransport, plugins: { - 'core.transport.retry': { baseMs: 1, capMs: 2, multiplier: 2, jitterPct: 0, maxAttempts: 1 }, + 'core.transport.retry': false, 'core.transport.timeout': false, }, });