Cypress 16 regression: Test Replay afterSpec times out after ~7 minutes in Chrome/Edge; forceHttp1: true avoids it
Current behavior
After upgrading from Cypress 15.21.1 to 16.0.0, we started seeing prolonged stalls after specs finish, including specs where all tests pass. The issue persists on 16.1.0.
With --record --parallel and Test Replay enabled, Chrome and Edge jobs frequently pause for approximately 420 seconds after a spec completes, then report:
Warning: We encountered an error while recording Test Replay data for this spec.
These results will not display Test Replay recordings.
...
Error: afterSpec timed out: {
"drainCDPEvents": 0.029296875,
"drainAUTEvents": 0.0244140625
}
(Uploading Cloud Artifacts)
- Test Replay - Failed Capturing - afterSpec timed out: {...}The affected spec loses its Test Replay recording, and the job spends approximately seven additional minutes waiting. We also see shorter stalls of approximately 130–310 seconds that recover and successfully upload the replay.
In our suite, this predominantly affects longer end-to-end specs with many XHR/fetch requests to an API on another origin.
We ran three paired comparisons on Cypress 16.1.0. Each pair ran concurrently against the same staging environment, using the same application commit, test suite, browser versions, parallelization, retries, and Replay settings. The only configuration difference was forceHttp1: true.
- Default networking: All three control runs exhibited
afterSpectimeouts, affecting 7–11 jobs per run. forceHttp1: true: NoafterSpectimeouts across three runs. All 72/72 spec replays uploaded, with measured post-spec idle time of approximately 2–12 seconds.
Including an earlier 16.1.0 baseline, we observed 34 timeout-affected jobs out of 48 jobs across four default-networking runs.
After these comparisons, we applied the workaround in our production release pipeline and confirmed that it resolved the observed hanging behavior there as well.
This suggests an interaction between the native browser networking path and Test Replay's post-spec processing, but we have not isolated the underlying cause. We understand forceHttp1 is deprecated and are treating it as a temporary workaround.
Desired behavior
Post-spec processing should finish promptly and upload Test Replay recordings, as it did in our observed Cypress 15.21.1 runs, without requiring the deprecated forceHttp1 option.
Test code to reproduce
So far, we can reproduce this reliably in our private end-to-end suite, but we do not yet have a minimal public reproduction. The following describes our reproduction conditions; it is not a standalone reproducer:
- Run the suite on Cypress 16.1.0 in headed Chrome or Edge, with Cypress Cloud recording, Test Replay, and parallel execution enabled.
- Run longer end-to-end specs against an HTTPS Next.js application that makes many XHR/fetch requests to an HTTPS API on another origin.
- After tests complete, observe the prolonged post-spec wait followed by
afterSpec timed outand a missing replay. - Repeat with
forceHttp1: truein the Cypress configuration and otherwise identical settings. In our paired runs, the timeout disappears and all replays upload successfully.
We can share affected Cypress Cloud run URLs, project IDs, and detailed logs privately with the Cypress team through support. Please let us know which additional debug logging would help isolate the issue.
Cypress Version
16.0.0 and 16.1.0. Last observed unaffected version: 15.21.1.
Debug Logs
The error excerpt is included above. Full debug logs are not attached to this report.
Other
- Chrome for Testing: 148.0.7778.167
- Microsoft Edge: 153.0.4234.48
- Both browsers run headed through
cypress-io/[email protected] - GitHub Actions runner:
ubuntu-22.04 - Node.js: 24.19.0
- Cypress Cloud recording and Test Replay enabled
- Parallel execution: three containers per app/browser group
- Test retries:
2 - Application: Next.js, served over HTTPS, calling an HTTPS API on another origin
- No
experimentalOriginDependenciesorblockHosts; nocy.interceptcalls in the affected specs
The upgrade to 16.1.0 did not resolve this post-spec stall.
Source: cypress-io/cypress