diff --git a/web/vitest.setup.ts b/web/vitest.setup.ts index 967f7a1..1dbb3b1 100644 --- a/web/vitest.setup.ts +++ b/web/vitest.setup.ts @@ -10,6 +10,8 @@ * failing loudly. */ +import { configure } from "@testing-library/react"; + function escapeIdentifier(value: string): string { let result = ""; for (let index = 0; index < value.length; index += 1) { @@ -47,3 +49,14 @@ if (globalThis.CSS === undefined) { } else if (typeof globalThis.CSS.escape !== "function") { globalThis.CSS.escape = escapeIdentifier; } + +/** + * Testing Library retries a `findBy*` query for 1000 ms by default. That is + * enough on an idle laptop — the whole suite resolves in well under a second — + * but not on a CI runner whose container competes for CPU with a concurrent + * zig build: `LocalDnsPage.test.tsx` timed out waiting for its heading while + * the page was still suspended on its first query (gates run 516, job 696). + * The budget is not the behaviour under test, so it is raised globally rather + * than per call; a test that genuinely never resolves still fails, only later. + */ +configure({ asyncUtilTimeout: 5000 });