Revert "[test] Skip flaky cached-navigations tests"#93798
Merged
lubieowoce merged 2 commits intoMay 13, 2026
Merged
Conversation
Contributor
Tests PassedCommit: 0251ced |
Contributor
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URLCommit: 0251ced |
The client-side `BrowserContext._onRequestFailed` handler in `playwright-core` does not resolve the corresponding `Response._finishedPromise`, while `_onRequestFinished` does. When Chromium fires `Network.loadingFailed` for a request that already received a response — e.g. an RSC response that was delivered to the response buffer but is no longer needed because a soft navigation has already committed — the server-side `_finishedPromise` is resolved correctly (in `chromium/crNetworkManager._onLoadingFailed`), but the client side is never told. Any caller of `response.finished()` on such a response hangs indefinitely, surfacing in tests as a 60s Jest timeout with no clear stack trace. This is the root cause of intermittent timeouts in router-act-using tests. The patch mirrors the resolve step from `_onRequestFinished`: look up the response via the existing async `request.response()` RPC and fire-and-forget `resolve(null)` on its `_finishedPromise`. `catch` is a no-op so a tearing-down context doesn't produce an unhandled rejection. Verified empirically against workflow run https://github.com/vercel/next.js/actions/runs/25760869258, which flake-detected all 40 router-act consumers (each 3 times) with diagnostic logging enabled. One `Network.loadingFailed canceled=true` event fired during the run (the canonical bug scenario: an outer `act` releasing a child `block: true` response that Chrome canceled mid-flight; see https://github.com/vercel/next.js/actions/runs/25760869258/job/75669131568) — pre-patch this would have hung until Jest's 60s test timeout fired, post-patch `response.finished()` resolved in 1ms. Alongside ~4000 normal resolutions, with zero `wait-browser-finished` hangs and zero router-act-related test failures. This is a stop-gap until the router-act rewrite in #90959 lands, which replaces Playwright's `route.fulfill` + `response.finished()` flow with a browser-side `fetch` interception and removes the dependency on this Playwright code path entirely. The patch can be dropped at that point.
This reverts commit d6ab9e2.
cfe8e3a to
0251ced
Compare
lubieowoce
previously approved these changes
May 13, 2026
lubieowoce
approved these changes
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #92199.
Depends on #93802, which patches
playwright-coreto fix the root cause: the client-sideResponse._finishedPromisewas never resolved onrequestFailed, causingresponse.finished()to hang indefinitely and surface as opaque 60s Jest timeouts in router-act-using tests.With that patch in place, the cached-navigations tests can be reinstated. This PR's CI is part of the verification path — the previously-flaky tests now run cleanly through the 3× flake-detection job.