Skip to content

test(e2e): wait for hydration before dev overlay recovery click - #2410

Merged
james-elicx merged 1 commit into
cloudflare:mainfrom
NathanDrake2406:nathan/fix-dev-overlay-recovery-flake
Jun 29, 2026
Merged

james-elicx merged 1 commit into
cloudflare:mainfrom
NathanDrake2406:nathan/fix-dev-overlay-recovery-flake

Conversation

@NathanDrake2406

Copy link
Copy Markdown
Contributor

Fixes #2409

Overview

The app-with-src dev overlay recovery E2E now waits for the shared App Router hydration signal before setting the reload canary and clicking the recovery Link.

Why

The flaky failure was a real test race: the previous wait only proved that the navigation runtime object existed. It did not prove React had hydrated the client tree that intercepts the Link click, so CI could occasionally perform a hard navigation before the soft-nav path was ready.

What changed

  • Replaced the partial runtime-exists polling with waitForAppRouterHydration(page).
  • Kept the actual browser click path so the test still covers the user-visible recovery flow.

Validation

  • PLAYWRIGHT_PROJECT=app-with-src vp exec playwright test tests/e2e/app-with-src/dev-overlay-recovery.spec.ts --project=app-with-src --repeat-each=10 --retries=0
  • PLAYWRIGHT_PROJECT=app-with-src vp exec playwright test --project=app-with-src --retries=0
  • vp check tests/e2e/app-with-src/dev-overlay-recovery.spec.ts

The dev overlay recovery spec armed its reload canary after only confirming that the navigation runtime existed. That was not enough to prove the app-router client tree had hydrated the Link handler, so CI could occasionally follow the anchor as a hard navigation before the soft-nav path was ready.

Reuse the shared app-router hydration helper before setting the canary and clicking the recovery link. The test still exercises the real browser click path, but no longer races client hydration.
@pkg-pr-new

pkg-pr-new Bot commented Jun 29, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vinext/cloudflare@2410
npm i https://pkg.pr.new/vinext@2410

commit: 2646508

@github-actions

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared 2646508 against base 23ed801 using alternating same-runner rounds. Next.js was unchanged and skipped.

0 improved · 0 regressed · 6 within ±1.5%

Scenario Framework Baseline Current Change
Client bundle size (gzip) vinext 124.0 KB 124.0 KB ⚫ +0.0%
Client entry size (gzip) vinext 118.8 KB 118.8 KB ⚫ 0.0%
Dev server cold start vinext 2.53 s 2.49 s ⚫ -1.5%
Production build time vinext 3.07 s 3.07 s ⚫ -0.1%
RSC entry closure size (gzip) vinext 95.2 KB 95.2 KB ⚫ +0.0%
Server bundle size (gzip) vinext 161.5 KB 161.5 KB ⚫ -0.0%

View detailed results and traces

🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head

@james-elicx
james-elicx merged commit 25f3d09 into cloudflare:main Jun 29, 2026
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky app-with-src dev overlay recovery E2E can hard-navigate before Link hydration

2 participants