diff --git a/clients/web/src/components/elements/JsonObjectInput/JsonObjectInput.stories.tsx b/clients/web/src/components/elements/JsonObjectInput/JsonObjectInput.stories.tsx index 82a6bcc3..d5565f8e 100644 --- a/clients/web/src/components/elements/JsonObjectInput/JsonObjectInput.stories.tsx +++ b/clients/web/src/components/elements/JsonObjectInput/JsonObjectInput.stories.tsx @@ -209,9 +209,12 @@ export const AnnotatesTheOffendingLine: Story = { await expect(annotations.length).toBeGreaterThan(0); await expect(annotations.some((a) => a.type === "error")).toBe(true); }, - // The worker is asynchronous and debounced, so this needs a real wait - // rather than a tick. - { timeout: 5000 }, + // The worker is asynchronous, starts out of process and debounces its + // result, so this needs a real wait rather than a tick — and a budget + // that survives a loaded machine, where 5000ms did not (#2292). It also + // has to stay under the storybook project's `testTimeout`, or the test is + // killed before the wait can report what it saw. + { timeout: 10000 }, ); }, }; diff --git a/clients/web/vite.config.ts b/clients/web/vite.config.ts index 65311ba6..97034569 100644 --- a/clients/web/vite.config.ts +++ b/clients/web/vite.config.ts @@ -375,6 +375,16 @@ export default defineConfig(({ command }) => { ], test: { name: "storybook", + // Vitest's default is 5000ms, which is the whole budget a play + // function gets — including work that is genuinely slow rather than + // racy. `JsonObjectInput`'s "Annotates The Offending Line" waits on + // Ace's JSON worker, which starts out of process and debounces its + // result; its own `waitFor` asked for 5000ms and so could never win + // against the per-test ceiling, and it lost on a loaded machine + // (#2292). A larger ceiling does not hide a defect here: a story + // that blows 15s has genuinely failed, and every assertion stays as + // strict as it was. + testTimeout: 15000, browser: { enabled: true, headless: true,