diff --git a/tests/integration/format-matrix-comprehensive.test.ts b/tests/integration/format-matrix-comprehensive.test.ts index d1c4fbe6..601c365a 100644 --- a/tests/integration/format-matrix-comprehensive.test.ts +++ b/tests/integration/format-matrix-comprehensive.test.ts @@ -188,8 +188,10 @@ function needsFallback(fmt: FormatDef): boolean { return fmt.needsCliDecoder || fmt.needsHeifDecoder || fmt.mayFailValidation; } -function getTimeout(fmt: FormatDef): number | undefined { - return fmt.needsHeifDecoder || fmt.needsCliDecoder ? 180_000 : undefined; +function getTimeout(fmt: FormatDef, toolId?: string): number | undefined { + if (fmt.needsHeifDecoder || fmt.needsCliDecoder) return 180_000; + if (toolId === "image-enhancement") return 120_000; + return undefined; } // --------------------------------------------------------------------------- @@ -639,7 +641,7 @@ describe("Image enhancement across all 16 primary formats", () => { if (!res) return; assertDownloadResponse(res, fmt); }, - getTimeout(fmt), + getTimeout(fmt, "image-enhancement"), ); } }); @@ -896,7 +898,7 @@ describe("No-crash matrix: 16 formats x 12 tools", () => { expect(body.error.length).toBeGreaterThan(0); } }, - getTimeout(fmt), + getTimeout(fmt, tool.id), ); } }); diff --git a/tests/integration/format-matrix.test.ts b/tests/integration/format-matrix.test.ts index 8ec2f96c..47c13b68 100644 --- a/tests/integration/format-matrix.test.ts +++ b/tests/integration/format-matrix.test.ts @@ -484,7 +484,12 @@ describe("Cross-format matrix", () => { // Skip "Convert to PNG" when input is already PNG (no-op conversion) if (tool.id === "convert" && fmt.name === "PNG") continue; - const perTestTimeout = fmt.needsHeifDecoder || fmt.needsCliDecoder ? 180_000 : undefined; + const perTestTimeout = + fmt.needsHeifDecoder || fmt.needsCliDecoder + ? 180_000 + : tool.id === "image-enhancement" + ? 120_000 + : undefined; it( `${tool.label}`, diff --git a/tests/integration/image-enhancement.test.ts b/tests/integration/image-enhancement.test.ts index 91fac576..626d739c 100644 --- a/tests/integration/image-enhancement.test.ts +++ b/tests/integration/image-enhancement.test.ts @@ -609,7 +609,7 @@ describe("Alpha channel preservation", () => { // ── Large file handling ───────────────────────────────────────── describe("Large file handling", () => { - it("enhances a large stress image", async () => { + it("enhances a large stress image", { timeout: 120_000 }, async () => { const large = readFileSync(join(FIXTURES, "content", "stress-large.jpg")); const res = await postTool( { mode: "auto", intensity: 50 }, @@ -951,7 +951,7 @@ describe("Invalid image data", () => { // ── Large file with specific modes ────────────────────────────── describe("Large file with modes", () => { - it("enhances large image in low-light mode", async () => { + it("enhances large image in low-light mode", { timeout: 120_000 }, async () => { const large = readFileSync(join(FIXTURES, "content", "stress-large.jpg")); const res = await postTool( { mode: "low-light", intensity: 70 }, @@ -964,7 +964,7 @@ describe("Large file with modes", () => { expect(result.processedSize).toBeGreaterThan(0); }); - it("enhances large image in document mode", async () => { + it("enhances large image in document mode", { timeout: 120_000 }, async () => { const large = readFileSync(join(FIXTURES, "content", "stress-large.jpg")); const res = await postTool( { mode: "document", intensity: 90 },