From efc1a052bdfd921085282e1804a2e2ab63f6a068 Mon Sep 17 00:00:00 2001 From: clawbot <35+clawbot@noreply.example.org> Date: Fri, 2 Oct 2026 01:51:21 +0000 Subject: [PATCH] Thumbnail test: re-encode a small image so it cannot time out (closes #153) The test "re-encodes smaller until the thumbnail fits the recorded size" built a noisy 400x300 JPEG and encoded it several times. That came close to vitest's 5 s limit and timed out on a busy host, which made `script/cibuild` fail on `next` and `main`. It now uses a noisy 64x48 JPEG, still too big for the first, default-quality encoding to fit, and keeps every assertion. It runs in about 1 s. Model: opus-5-5 --- test/thumbnails/thumbnails.test.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/thumbnails/thumbnails.test.ts b/test/thumbnails/thumbnails.test.ts index 580a312..4acd89b 100644 --- a/test/thumbnails/thumbnails.test.ts +++ b/test/thumbnails/thumbnails.test.ts @@ -787,12 +787,13 @@ describe("fixMissingThumbnails", () => { }); it("re-encodes smaller until the thumbnail fits the recorded size", async () => { - // A noisy 400x300 JPEG, which the default encoding (quality 50, not + // A noisy 64x48 JPEG, which the default encoding (quality 50, not // resized because it is under 720 px) cannot compress below the size - // recorded here: one byte less than that encoding's ciphertext. + // recorded here: one byte less than that encoding's ciphertext. It is + // small so that each encode is quick even on a busy host. const fixMock = await buildThumbMock(); - const w = 400; - const h = 300; + const w = 64; + const h = 48; const noisy = new Uint8Array( jpegJs.encode( { -- 2.54.0