Skip to content

Commit d52e599

Browse files
authored
🤖 fix: increase storybook helper timeout for CI cold start (#1298)
## Summary Fixes intermittent flakes in Storybook tests (including TaskWorkflow) during CI cold-start scenarios. ## Problem The `waitForChatMessagesLoaded` helper in `storyPlayHelpers.ts` used a 5 second timeout. In CI, the first test(s) can take longer to load due to large dependencies (Shiki, Mermaid) being initialized. This caused failures with the error: ``` Message: Messages not loaded yet ``` Example failure in [CI run 20416096418](https://github.com/coder/mux/actions/runs/20416096418) for TaskWorkflow story. ## Fix Bumped timeout from 5s to 15s, matching the fix in `App.markdown.stories.tsx` (fcecf80) for the same cold-start issue. ## Testing - `make typecheck` passes - Ran storybook tests 5 times locally, all passed --- _Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking: `high`_
1 parent ce3bb39 commit d52e599

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/browser/stories/storyPlayHelpers.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ import { waitFor } from "@storybook/test";
77
* to let any pending coalesced scroll from useAutoScroll complete.
88
*/
99
export async function waitForChatMessagesLoaded(canvasElement: HTMLElement): Promise<void> {
10+
// Use 15s timeout to handle CI cold-start scenarios where large dependencies
11+
// (Shiki, Mermaid) are still being loaded/initialized
1012
await waitFor(
1113
() => {
1214
const messageWindow = canvasElement.querySelector('[data-testid="message-window"]');
1315
if (!messageWindow || messageWindow.getAttribute("data-loaded") !== "true") {
1416
throw new Error("Messages not loaded yet");
1517
}
1618
},
17-
{ timeout: 5000 }
19+
{ timeout: 15000 }
1820
);
1921

2022
// One RAF to let any pending coalesced scroll complete

0 commit comments

Comments
 (0)