Skip to content

Commit 109efc0

Browse files
sadpandajoeclaude
andcommitted
fix(playwright): split saved-query nav+API into two waits for CI stability
The saved-query test waited for a single GET response with a 15 s budget that had to cover full-page navigation, JS hydration, AND the API call. Under CI load (parallel test suites) navigation alone exceeded 10 s, leaving too little headroom for the API response. Split into two sequential waits — PAGE_LOAD (10 s) for navigation, then API_RESPONSE (15 s) for the hydration fetch — so each phase gets its own timeout budget. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ad19e8c commit 109efc0

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

superset-frontend/playwright/tests/sqllab/sqllab.spec.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,18 @@ test('saves a query and loads it from saved queries', async ({
232232
const queryLink = page.getByRole('link', { name: savedQueryTitle });
233233
await queryLink.waitFor({ state: 'visible', timeout: TIMEOUT.API_RESPONSE });
234234

235-
// Click the query name to open it in SQL Lab (exercises the list → SQL Lab path)
236-
const savedQueryHydration = waitForGet(
237-
page,
238-
`api/v1/saved_query/${savedQueryId}`,
239-
{ timeout: TIMEOUT.API_RESPONSE },
240-
);
235+
// Click the query name to open it in SQL Lab (exercises the list → SQL Lab path).
236+
// Split into two waits so each phase gets its own timeout budget:
237+
// 1. Full-page navigation (slow under CI load)
238+
// 2. Saved-query API hydration (fires in useEffect after paint)
241239
await queryLink.click();
242-
await savedQueryHydration;
240+
await page.waitForURL(/sqllab/, {
241+
waitUntil: 'load',
242+
timeout: TIMEOUT.PAGE_LOAD,
243+
});
244+
await waitForGet(page, `api/v1/saved_query/${savedQueryId}`, {
245+
timeout: TIMEOUT.API_RESPONSE,
246+
});
243247
await sqlLabPage.waitForPageLoad();
244248
await sqlLabPage.ensureEditorReady();
245249

0 commit comments

Comments
 (0)