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:
@@ -233,7 +233,7 @@ describe("watermark-image", () => {
|
||||
|
||||
// ── HEIC input handling ───────────────────────────────────────────
|
||||
|
||||
it("processes HEIC main image", async () => {
|
||||
it("processes HEIC main image", { timeout: 120_000 }, async () => {
|
||||
const HEIC = readFileSync(join(FIXTURES, "test-200x150.heic"));
|
||||
const { body, contentType } = createMultipartPayload([
|
||||
{ name: "file", filename: "photo.heic", contentType: "image/heic", content: HEIC },
|
||||
@@ -381,7 +381,7 @@ describe("watermark-image", () => {
|
||||
|
||||
// ── HEIC watermark image ─────────────────────────────────────────
|
||||
|
||||
it("processes HEIC watermark image", async () => {
|
||||
it("processes HEIC watermark image", { timeout: 120_000 }, async () => {
|
||||
const HEIC = readFileSync(join(FIXTURES, "test-200x150.heic"));
|
||||
const { body, contentType } = createMultipartPayload([
|
||||
{ name: "file", filename: "main.png", contentType: "image/png", content: PNG },
|
||||
@@ -485,26 +485,31 @@ describe("watermark-image", () => {
|
||||
|
||||
// ── HEIF input ────────────────────────────────────────────────────
|
||||
|
||||
it("processes HEIF main image (motorcycle.heif)", async () => {
|
||||
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
||||
const { body, contentType } = createMultipartPayload([
|
||||
{ name: "file", filename: "photo.heif", contentType: "image/heif", content: HEIF },
|
||||
{ name: "watermark", filename: "wm.png", contentType: "image/png", content: SMALL_PNG },
|
||||
{ name: "settings", content: JSON.stringify({ scale: 10 }) },
|
||||
]);
|
||||
it(
|
||||
"processes HEIF main image (motorcycle.heif)",
|
||||
{ timeout: 120_000 },
|
||||
async () => {
|
||||
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
||||
const { body, contentType } = createMultipartPayload([
|
||||
{ name: "file", filename: "photo.heif", contentType: "image/heif", content: HEIF },
|
||||
{ name: "watermark", filename: "wm.png", contentType: "image/png", content: SMALL_PNG },
|
||||
{ name: "settings", content: JSON.stringify({ scale: 10 }) },
|
||||
]);
|
||||
|
||||
const res = await app.inject({
|
||||
method: "POST",
|
||||
url: "/api/v1/tools/watermark-image",
|
||||
headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType },
|
||||
body,
|
||||
});
|
||||
const res = await app.inject({
|
||||
method: "POST",
|
||||
url: "/api/v1/tools/watermark-image",
|
||||
headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType },
|
||||
body,
|
||||
});
|
||||
|
||||
expect(res.statusCode).toBe(200);
|
||||
const json = JSON.parse(res.body);
|
||||
expect(json.downloadUrl).toBeDefined();
|
||||
expect(json.processedSize).toBeGreaterThan(0);
|
||||
}, 60_000);
|
||||
expect(res.statusCode).toBe(200);
|
||||
const json = JSON.parse(res.body);
|
||||
expect(json.downloadUrl).toBeDefined();
|
||||
expect(json.processedSize).toBeGreaterThan(0);
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
|
||||
// ── Animated GIF input ──────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user