fix(fuzz): bound settings-fuzz inputs, cap split tiles, budget the slow codecs, steady flakes (#696)

Follow-up to #695, greening the last nightly jobs it exposed. split gains a 400-tile product cap (a 100x100 split was a 10,000-file ZIP and ~20s of work). The settings-fuzz bounds its image inputs to 640px and gives the tools whose cost is output-driven (border, gif-tools, split) or codec-driven (heic/webp-to-avif) honest per-case budgets, since #649's settle-job wiring made every case wait for the real encode. The delete-team serial spec waits with toHaveCount(0) so the success toast can't trip strict mode, and type-to-search allows a route announcer's programmatic reading focus so it works on WebKit. Confirmed on a nightly dispatch: Extended Matrix (all 4 shards), Serial Bucket, Cross-Browser, and Coverage all green; Docker Container E2E's failures were GitHub runner reclamation (exit 137, tests passing throughout), which cleared on the #695 dispatch and is unaffected by this change.
This commit is contained in:
SnapOtter
2026-07-31 06:56:44 +08:00
committed by GitHub
parent 1b41da7615
commit c0dc037860
7 changed files with 111 additions and 4 deletions
@@ -238,6 +238,26 @@ describe("Split", () => {
expect(res.statusCode).toBe(400);
});
it("rejects a grid whose total tile count would be pathological", async () => {
// Each axis is schema-valid (<=100), but 100x100 is 10,000 tiles: ~20s of
// work and a 10,000-file ZIP from one request. Bound the product so a
// single split cannot spin the worker (fuzz seed 20260724, #695 follow-up).
const { body, contentType } = createMultipartPayload([
{ name: "file", filename: "test.png", contentType: "image/png", content: PNG },
{ name: "settings", content: JSON.stringify({ columns: 100, rows: 100 }) },
]);
const res = await app.inject({
method: "POST",
url: "/api/v1/tools/image/split",
headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType },
body,
});
expect(res.statusCode).toBe(400);
expect(JSON.parse(res.body).error).toMatch(/tile/i);
});
it("rejects unauthenticated requests", async () => {
const { body, contentType } = createMultipartPayload([
{ name: "file", filename: "test.png", contentType: "image/png", content: PNG },