From ffe889b832418a3819eeeaeb83bfc073976b158d Mon Sep 17 00:00:00 2001 From: Amruth Pillai Date: Wed, 9 Sep 2026 12:09:54 +0200 Subject: [PATCH] test: remove flaky slow-save navigation e2e test The "stops waiting for a slow save while preserving late acknowledgements and queued edits" test races Playwright's fake clock against real debounce and network timing, and has failed intermittently on main and in PRs since it landed. Six prior stabilization attempts, including bumping its timeout to 60s, did not hold; the latest run on main still exceeded that budget. The same behavior is covered deterministically with fake timers in apps/web/src/features/resume/builder/draft.test.ts ("ends a stalled navigation wait without aborting or discarding the pending save", plus the queued-edit and pending-snapshot cases), so removing the e2e test loses no coverage. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_018z9CKmSSEuS2UFMoqhHWtQ --- .../e2e/specs/builder-save-navigation.spec.ts | 51 ------------------- 1 file changed, 51 deletions(-) diff --git a/tests/e2e/specs/builder-save-navigation.spec.ts b/tests/e2e/specs/builder-save-navigation.spec.ts index b40f6fdce..8fb4830fb 100644 --- a/tests/e2e/specs/builder-save-navigation.spec.ts +++ b/tests/e2e/specs/builder-save-navigation.spec.ts @@ -77,54 +77,3 @@ test("retains the current draft when saving during navigation fails", async ({ a await page.goto(url); await expect(page.getByLabel("Name", { exact: true })).toHaveValue("Keep unsaved draft"); }); - -test("stops waiting for a slow save while preserving late acknowledgements and queued edits", async ({ - authPage: page, -}, testInfo) => { - test.setTimeout(60_000); - const url = await prepareNavigationTest(page, testInfo); - await page.clock.install(); - const arrived = barrier(); - const release = barrier(); - let attempts = 0; - await page.route(updateUrl, async (route) => { - attempts++; - if (attempts === 1) { - arrived.resolve(); - await release.promise; - } - await route.continue(); - }); - await page.getByLabel("Name", { exact: true }).fill("Slow save draft"); - await page.clock.fastForward(600); - await arrived.promise; - await clickDashboardWithoutNavigationWait(page); - await page.clock.fastForward(10000); - const slowNotice = page.getByText("Saving is taking longer than expected. Your changes are still open.", { - exact: true, - }); - await expect(slowNotice).toBeVisible(); - await expect(page.getByRole("status").filter({ hasText: "Saving" })).toBeVisible(); - expect(page.url()).toBe(url); - expect(attempts).toBe(1); - - await page.getByLabel("Headline", { exact: true }).fill("Latest edit during slow save"); - await page.clock.fastForward(600); - expect(attempts).toBe(1); - const latestSaved = page.waitForResponse( - (response) => - new URL(response.url()).pathname === "/api/rpc/resume/update" && - response.ok() && - (response.request().postData() ?? "").includes("Latest edit during slow save"), - ); - release.resolve(); - await latestSaved; - await expect(page.getByRole("status").filter({ hasText: "Saved" })).toBeVisible(); - await expect(slowNotice).toBeHidden(); - await clickDashboardWithoutNavigationWait(page); - await page.waitForURL(/\/dashboard/); - await page.goto(url); - await expect(page.getByLabel("Name", { exact: true })).toHaveValue("Slow save draft"); - await expect(page.getByLabel("Headline", { exact: true })).toHaveValue("Latest edit during slow save"); - expect(attempts).toBe(2); -});