mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
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:
@@ -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([
|
||||
|
||||
Reference in New Issue
Block a user