Skip to content

Commit ee4863b

Browse files
committed
increate user flow state timeout
1 parent e4e0686 commit ee4863b

2 files changed

Lines changed: 37 additions & 29 deletions

File tree

src/frontend/tests/core/features/traces.spec.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,19 @@ test(
2020
await awaitBootstrapTest(page);
2121

2222
await page.getByTestId("side_nav_options_all-templates").click();
23+
// Tie the wait to the actual flow-creation network response. On Windows
24+
// CI the click → canvas mount can outlast a 100s wait when the backend
25+
// is under load, but if the POST /flows succeeds we know the page will
26+
// navigate; we then wait for the canvas with a generous budget.
27+
const flowCreatePromise = page.waitForResponse(
28+
(response) =>
29+
/\/api\/v1\/flows\/?(?:\?|$)/.test(response.url()) &&
30+
response.request().method() === "POST" &&
31+
response.status() === 201,
32+
{ timeout: 120000 },
33+
);
2334
await page.getByRole("heading", { name: "Basic Prompting" }).click();
35+
await flowCreatePromise;
2436
await page.waitForSelector('[data-testid="canvas_controls_dropdown"]', {
2537
timeout: 100000,
2638
});
@@ -76,7 +88,19 @@ test.skip(
7688
await awaitBootstrapTest(page);
7789

7890
await page.getByTestId("side_nav_options_all-templates").click();
91+
// Tie the wait to the actual flow-creation network response. On Windows
92+
// CI the click → canvas mount can outlast a 100s wait when the backend
93+
// is under load, but if the POST /flows succeeds we know the page will
94+
// navigate; we then wait for the canvas with a generous budget.
95+
const flowCreatePromise = page.waitForResponse(
96+
(response) =>
97+
/\/api\/v1\/flows\/?(?:\?|$)/.test(response.url()) &&
98+
response.request().method() === "POST" &&
99+
response.status() === 201,
100+
{ timeout: 120000 },
101+
);
79102
await page.getByRole("heading", { name: "Basic Prompting" }).click();
103+
await flowCreatePromise;
80104
await page.waitForSelector('[data-testid="canvas_controls_dropdown"]', {
81105
timeout: 100000,
82106
});

src/frontend/tests/core/features/user-flow-state-cleanup.spec.ts

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -123,35 +123,19 @@ test(
123123
await page.waitForSelector('[data-testid="modal-title"]', {
124124
timeout: 30000,
125125
});
126-
await page.getByTestId("side_nav_options_all-templates").click();
127-
128-
const basicPromptingHeading = page.getByRole("heading", {
129-
name: "Basic Prompting",
130-
});
131-
await basicPromptingHeading.waitFor({ state: "visible", timeout: 30000 });
132-
133-
// Retry the template click if the canvas never mounts: on Windows CI the
134-
// first click occasionally lands before the template grid is interactive.
135-
let canvasMounted = false;
136-
const maxClickAttempts = 3;
137-
for (let attempt = 1; attempt <= maxClickAttempts; attempt++) {
138-
await basicPromptingHeading.click();
139-
try {
140-
await page.waitForSelector('[data-testid="canvas_controls_dropdown"]', {
141-
timeout: attempt === maxClickAttempts ? 240000 : 60000,
142-
});
143-
canvasMounted = true;
144-
break;
145-
} catch (_error) {
146-
if (attempt === maxClickAttempts) throw _error;
147-
const modalStillOpen =
148-
(await page.getByTestId("modal-title").count()) > 0;
149-
if (!modalStillOpen) throw _error;
150-
}
151-
}
152-
if (!canvasMounted) {
153-
throw new Error("canvas_controls_dropdown never appeared");
154-
}
126+
127+
// Use blank-flow instead of the Basic Prompting template. The template
128+
// path provisions multiple components on the backend and, on Windows CI
129+
// shards under load, the new-flow canvas can stay un-mounted past 240s.
130+
// This cleanup test only needs *some* flow owned by the user, so a blank
131+
// flow is equivalent in scope while avoiding the Windows-specific stall.
132+
await page.waitForSelector('[data-testid="blank-flow"]', {
133+
timeout: 30000,
134+
});
135+
await page.getByTestId("blank-flow").click();
136+
await page.waitForSelector('[data-testid="canvas_controls_dropdown"]', {
137+
timeout: 60000,
138+
});
155139

156140
await renameFlow(page, { flowName: userAFlowName });
157141

0 commit comments

Comments
 (0)