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
+26 -21
View File
@@ -320,30 +320,35 @@ describe("Content-Aware Resize", () => {
expect(result.error).toMatch(/invalid image/i);
});
it("handles HEIC input (decodes before processing)", async () => {
const { body, contentType } = createMultipartPayload([
{ name: "file", filename: "test.heic", contentType: "image/heic", content: HEIC },
{ name: "settings", content: JSON.stringify({ width: 150, protectFaces: false }) },
]);
it(
"handles HEIC input (decodes before processing)",
{ timeout: 120_000 },
async () => {
const { body, contentType } = createMultipartPayload([
{ name: "file", filename: "test.heic", contentType: "image/heic", content: HEIC },
{ name: "settings", content: JSON.stringify({ width: 150, protectFaces: false }) },
]);
const res = await app.inject({
method: "POST",
url: "/api/v1/tools/content-aware-resize",
headers: {
authorization: `Bearer ${adminToken}`,
"content-type": contentType,
},
body,
});
const res = await app.inject({
method: "POST",
url: "/api/v1/tools/content-aware-resize",
headers: {
authorization: `Bearer ${adminToken}`,
"content-type": contentType,
},
body,
});
// HEIC decode or caire may not be available
expect([200, 422]).toContain(res.statusCode);
// HEIC decode or caire may not be available
expect([200, 422]).toContain(res.statusCode);
if (res.statusCode === 200) {
const resBody = JSON.parse(res.body);
expect(resBody.downloadUrl).toBeDefined();
}
}, 60_000);
if (res.statusCode === 200) {
const resBody = JSON.parse(res.body);
expect(resBody.downloadUrl).toBeDefined();
}
},
60_000,
);
it("processes both width and height simultaneously", async () => {
const { body, contentType } = createMultipartPayload([