fix: bump HEIF + image-enhancement CI timeout to 300s

HEIF decoding combined with image-enhancement (CLAHE + histogram +
multi-step corrections) exceeds 180s on GitHub Actions runners.
HEIC works fine (~4.5s) but HEIF specifically needs ~5min in CI.
This commit is contained in:
SnapOtter
2026-05-09 19:52:11 +08:00
parent db34157bcb
commit d2f5456624
3 changed files with 27 additions and 19 deletions
@@ -189,6 +189,8 @@ function needsFallback(fmt: FormatDef): boolean {
} }
function getTimeout(fmt: FormatDef, toolId?: string): number | undefined { function getTimeout(fmt: FormatDef, toolId?: string): number | undefined {
if ((fmt.needsHeifDecoder || fmt.needsCliDecoder) && toolId === "image-enhancement")
return 300_000;
if (fmt.needsHeifDecoder || fmt.needsCliDecoder) return 180_000; if (fmt.needsHeifDecoder || fmt.needsCliDecoder) return 180_000;
if (toolId === "image-enhancement") return 120_000; if (toolId === "image-enhancement") return 120_000;
return undefined; return undefined;
@@ -1051,7 +1053,9 @@ describe("HEIC/HEIF graceful handling", () => {
for (const fmt of HEIF_FORMATS) { for (const fmt of HEIF_FORMATS) {
describe(`${fmt.name}`, () => { describe(`${fmt.name}`, () => {
for (const tool of CORE_TOOLS) { for (const tool of CORE_TOOLS) {
it(`${tool.id}: no crash`, async () => { it(
`${tool.id}: no crash`,
async () => {
const res = await callTool(tool.id, fmt, tool.settings); const res = await callTool(tool.id, fmt, tool.settings);
if (!res) return; if (!res) return;
@@ -1066,7 +1070,9 @@ describe("HEIC/HEIF graceful handling", () => {
expect(body.error).toBeDefined(); expect(body.error).toBeDefined();
expect(typeof body.error).toBe("string"); expect(typeof body.error).toBe("string");
} }
}, 180_000); },
tool.id === "image-enhancement" ? 300_000 : 180_000,
);
} }
}); });
} }
+3 -1
View File
@@ -485,7 +485,9 @@ describe("Cross-format matrix", () => {
if (tool.id === "convert" && fmt.name === "PNG") continue; if (tool.id === "convert" && fmt.name === "PNG") continue;
const perTestTimeout = const perTestTimeout =
fmt.needsHeifDecoder || fmt.needsCliDecoder (fmt.needsHeifDecoder || fmt.needsCliDecoder) && tool.id === "image-enhancement"
? 300_000
: fmt.needsHeifDecoder || fmt.needsCliDecoder
? 180_000 ? 180_000
: tool.id === "image-enhancement" : tool.id === "image-enhancement"
? 120_000 ? 120_000
+1 -1
View File
@@ -678,7 +678,7 @@ describe("Authentication", () => {
// ── HEIF input ───────────────────────────────────────────────── // ── HEIF input ─────────────────────────────────────────────────
describe("HEIF input", () => { describe("HEIF input", () => {
it("enhances HEIF (sample.heif) input", { timeout: 120_000 }, async () => { it("enhances HEIF (sample.heif) input", { timeout: 300_000 }, async () => {
const HEIF = readFileSync(join(FIXTURES, "formats", "sample.heif")); const HEIF = readFileSync(join(FIXTURES, "formats", "sample.heif"));
const res = await postTool({ mode: "auto" }, HEIF, "sample.heif", "image/heif"); const res = await postTool({ mode: "auto" }, HEIF, "sample.heif", "image/heif");
expect([200, 422]).toContain(res.statusCode); expect([200, 422]).toContain(res.statusCode);