mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
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:
@@ -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,22 +1053,26 @@ 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(
|
||||||
const res = await callTool(tool.id, fmt, tool.settings);
|
`${tool.id}: no crash`,
|
||||||
if (!res) return;
|
async () => {
|
||||||
|
const res = await callTool(tool.id, fmt, tool.settings);
|
||||||
|
if (!res) return;
|
||||||
|
|
||||||
// Must never crash
|
// Must never crash
|
||||||
expect(res.statusCode).not.toBe(500);
|
expect(res.statusCode).not.toBe(500);
|
||||||
|
|
||||||
// Accept success (200) or clean error (400/422)
|
// Accept success (200) or clean error (400/422)
|
||||||
expect([200, 400, 422]).toContain(res.statusCode);
|
expect([200, 400, 422]).toContain(res.statusCode);
|
||||||
|
|
||||||
const body = JSON.parse(res.body);
|
const body = JSON.parse(res.body);
|
||||||
if (res.statusCode !== 200) {
|
if (res.statusCode !== 200) {
|
||||||
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,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -485,11 +485,13 @@ 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"
|
||||||
? 180_000
|
? 300_000
|
||||||
: tool.id === "image-enhancement"
|
: fmt.needsHeifDecoder || fmt.needsCliDecoder
|
||||||
? 120_000
|
? 180_000
|
||||||
: undefined;
|
: tool.id === "image-enhancement"
|
||||||
|
? 120_000
|
||||||
|
: undefined;
|
||||||
|
|
||||||
it(
|
it(
|
||||||
`${tool.label}`,
|
`${tool.label}`,
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user