From 36b167c594ab325325dd95561ec00ab5f860fe92 Mon Sep 17 00:00:00 2001 From: Preetam Dwivedi Date: Wed, 28 Oct 2026 14:18:39 -0700 Subject: [PATCH] fix(web): pause the e2e fake clock ahead of its install time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary ### Why? The header auto-refresh e2e tests install Playwright's fake clock at `now` and then call `pauseAt(now)`. The installed clock keeps running between the two calls, so when even a millisecond passes, `pauseAt` targets the past and throws `Cannot fast-forward to the past`. This failed the Stovepipe suite on #969 while the same test passed locally and on rerun. ### What? - The Stovepipe and SubmitQueue specs pause the clock one minute after the install time, so `pauseAt` always jumps forward. Auto-refresh is still off at that point and the Live indicator depends only on fetch failures, so the jump changes nothing the tests assert. ## Test Plan ✅ `bazel test //web/test/e2e/stovepipe:web_test //web/test/e2e/submitqueue:web_test --sandbox_writable_path=$HOME/.docker --local_test_jobs=1` --- web/test/e2e/stovepipe/stovepipe.spec.ts | 3 ++- web/test/e2e/submitqueue/submitqueue.spec.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/web/test/e2e/stovepipe/stovepipe.spec.ts b/web/test/e2e/stovepipe/stovepipe.spec.ts index b4bf082b0..9d896bb79 100644 --- a/web/test/e2e/stovepipe/stovepipe.spec.ts +++ b/web/test/e2e/stovepipe/stovepipe.spec.ts @@ -164,7 +164,8 @@ test("refreshes from the header only while auto-refresh is enabled", async ({ pa await expect(automatic).not.toBeChecked(); const now = new Date(); await page.clock.install({ time: now }); - await page.clock.pauseAt(now); + // The installed clock keeps running, so pausing at the install time races it. + await page.clock.pauseAt(new Date(now.getTime() + 60_000)); let refreshRequests = 0; const isRefresh = (request: import("@playwright/test").Request) => request.headers()["rsc"] === "1" && new URL(request.url()).pathname === new URL(page.url()).pathname; diff --git a/web/test/e2e/submitqueue/submitqueue.spec.ts b/web/test/e2e/submitqueue/submitqueue.spec.ts index 99796b481..60a95f324 100644 --- a/web/test/e2e/submitqueue/submitqueue.spec.ts +++ b/web/test/e2e/submitqueue/submitqueue.spec.ts @@ -312,7 +312,8 @@ test("refreshes from the header only while auto-refresh is enabled", async ({ pa await expect(automatic).not.toBeChecked(); const now = new Date(); await page.clock.install({ time: now }); - await page.clock.pauseAt(now); + // The installed clock keeps running, so pausing at the install time races it. + await page.clock.pauseAt(new Date(now.getTime() + 60_000)); let refreshRequests = 0; const isRefresh = (request: import("@playwright/test").Request) => request.headers()["rsc"] === "1" && new URL(request.url()).pathname === new URL(page.url()).pathname;