fix: add 120s timeout to all HEIF/HEIC integration tests for CI

Comprehensively adds { timeout: 120_000 } to every HEIF/HEIC
integration test across 40 test files. HEIF decoding on CI runners
is significantly slower than local, causing sporadic timeouts at
the default 5s or previous 60s limits.
This commit is contained in:
SnapOtter
2026-05-01 19:51:47 +08:00
parent 6a44c455a3
commit d1f2f63453
42 changed files with 465 additions and 361 deletions
+18 -13
View File
@@ -146,21 +146,26 @@ describe("ocr", () => {
expect([200, 501]).toContain(res.statusCode);
}, 60_000);
it("handles HEIC input (200 or 501)", async () => {
const { body, contentType } = createMultipartPayload([
{ name: "file", filename: "photo.heic", contentType: "image/heic", content: HEIC },
{ name: "settings", content: JSON.stringify({}) },
]);
it(
"handles HEIC input (200 or 501)",
{ timeout: 120_000 },
async () => {
const { body, contentType } = createMultipartPayload([
{ name: "file", filename: "photo.heic", contentType: "image/heic", content: HEIC },
{ name: "settings", content: JSON.stringify({}) },
]);
const res = await app.inject({
method: "POST",
url: "/api/v1/tools/ocr",
headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType },
body,
});
const res = await app.inject({
method: "POST",
url: "/api/v1/tools/ocr",
headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType },
body,
});
expect([200, 501]).toContain(res.statusCode);
}, 60_000);
expect([200, 501]).toContain(res.statusCode);
},
60_000,
);
it("handles 1x1 pixel input (200, 422, or 501)", async () => {
const { body, contentType } = createMultipartPayload([