fix: add CI timeouts for slow image-enhancement tests

Image enhancement involves CLAHE + histogram analysis + multi-step
corrections, which exceeds the default 30s vitest timeout on GitHub
Actions runners. Add 120s timeouts for image-enhancement tests
(large file, HEIF input, format-matrix cross-format).
This commit is contained in:
SnapOtter
2026-05-09 18:19:07 +08:00
parent a0556772e8
commit db34157bcb
3 changed files with 15 additions and 8 deletions
@@ -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),
);
}
});