From 0ef9cbecc9a833e4852f6705ffc8e0ab8a10ed01 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 25 Feb 2026 13:02:49 +0000 Subject: [PATCH] test: lock 5xx retry behavior in HTTP client (#457) (thanks @YonghaoZhao722) --- CHANGELOG.md | 1 + packages/clawdhub/src/http.test.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e3f8e59d3..6a7ae3d711 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ - CLI: respect `HTTPS_PROXY`/`HTTP_PROXY`/`NO_PROXY` env vars for outbound registry requests, with troubleshooting docs (#363) (thanks @kerrypotter). - CLI: preserve registry base paths when composing API URLs for search/inspect/moderation commands (#486) (thanks @Liknox). - API tests: lock `Retry-After` behavior to relative-delay semantics for v1 search 429s (#421) (thanks @apoorvdarshan). +- CLI tests: assert 5xx HTTP responses still perform retry attempts before surfacing final error (#457) (thanks @YonghaoZhao722). ## 0.6.1 - 2026-02-13 diff --git a/packages/clawdhub/src/http.test.ts b/packages/clawdhub/src/http.test.ts index 310c6a5d35..092753778e 100644 --- a/packages/clawdhub/src/http.test.ts +++ b/packages/clawdhub/src/http.test.ts @@ -203,6 +203,7 @@ describe('apiRequest', () => { }) it('falls back to HTTP status when body is empty', async () => { + mockImmediateTimeouts() const fetchMock = vi.fn().mockResolvedValue({ ok: false, status: 500, @@ -212,6 +213,7 @@ describe('apiRequest', () => { await expect( apiRequest('https://example.com', { method: 'GET', url: 'https://example.com/x' }), ).rejects.toThrow('HTTP 500') + expect(fetchMock).toHaveBeenCalledTimes(3) vi.unstubAllGlobals() })