From 326d0267944cb7dcf51050b4c1f9adfed2e3b93f Mon Sep 17 00:00:00 2001 From: openhands Date: Tue, 3 Mar 2026 00:20:47 +0000 Subject: [PATCH 1/2] fix: tests/setup/navigate.ts: bare 500ms timeout after pushState is fragile under CPU pressure (#390) Co-Authored-By: Claude Sonnet 4.6 --- tests/setup/navigate.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/setup/navigate.ts b/tests/setup/navigate.ts index 2e43b5b..c6cc6ab 100644 --- a/tests/setup/navigate.ts +++ b/tests/setup/navigate.ts @@ -12,6 +12,6 @@ export async function navigateSPA(page: Page, path: string): Promise { window.history.pushState({}, '', p); window.dispatchEvent(new PopStateEvent('popstate')); }, path); - // Give Vue Router time to resolve the route and render - await page.waitForTimeout(500); + // Wait for Vue Router to actually resolve the route (not a fixed delay) + await page.waitForURL((url) => url.pathname === path, { timeout: 10_000 }); } From f53e245f0ed450360d2c61c037401ae610a81d0b Mon Sep 17 00:00:00 2001 From: openhands Date: Tue, 3 Mar 2026 00:45:27 +0000 Subject: [PATCH 2/2] fix: tests/setup/navigate.ts: bare 500ms timeout after pushState is fragile under CPU pressure (#390) Co-Authored-By: Claude Sonnet 4.6 --- tests/setup/navigate.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/setup/navigate.ts b/tests/setup/navigate.ts index c6cc6ab..5770635 100644 --- a/tests/setup/navigate.ts +++ b/tests/setup/navigate.ts @@ -12,6 +12,9 @@ export async function navigateSPA(page: Page, path: string): Promise { window.history.pushState({}, '', p); window.dispatchEvent(new PopStateEvent('popstate')); }, path); - // Wait for Vue Router to actually resolve the route (not a fixed delay) - await page.waitForURL((url) => url.pathname === path, { timeout: 10_000 }); + // waitForURL would resolve immediately (pushState already updated the URL + // synchronously), so wait for networkidle instead: that fires once Vue Router + // has processed the popstate event, mounted the new view, and any route- + // triggered data fetches have settled. + await page.waitForLoadState('networkidle', { timeout: 10_000 }); }