Thumbnail test on main: re-encode a small image so it cannot time out (closes #153)
check / check (push) Waiting to run

The `main` half of the fix for the timed-out thumbnail test, carrying only the test change from `next` (d788c54). The test "re-encodes smaller until the thumbnail fits the recorded size" built a noisy 400x300 JPEG, which came close to vitest's 5 s limit and made `script/cibuild` fail on a busy host. It now uses a noisy 64x48 JPEG, keeps every assertion, and runs in about 1 s.

Model: opus-5-5
This commit was merged in pull request #158.
This commit is contained in:
2026-10-02 04:22:27 +02:00
parent 9e6e038545
commit c5a588177c
+5 -4
View File
@@ -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(
{