#34905·cypress

Cypress 16 Chrome native network: `cy.wait()` on a fetch form POST answered with 302 yields `response` undefined after "Timed out waiting for CDP Fetch response pause"

Author: MussadiqKhanCreated Sep 23, 2026Updated Sep 28, 2026
Labelstype: bugpkg/serverbrowser: chrometype: regressiontopic: networktopic: cy.intercept()v16.0.0 🐛

Current behavior

Current behavior

On Cypress 16.1.0 in Chrome, a plain cy.intercept().as() spy on a form submission that the page sends with fetch() (Hotwire Turbo Drive form submit, redirect: 'follow') and that the server answers with 302 Location: … never receives the response on the native network path.

cy.wait('@alias') resolves only after ~30 seconds, with interception.response undefined and interception.error set to:

Timed out waiting for CDP Fetch response pause for https://<app>/parents/<id>/children

The browser completed the request. The Command Log shows the (fetch) POST /parents/<id>/children entry with status 200 (the final status after following the 302), then (new url) as Turbo renders the redirected page, then follow-up *.turbo_stream GETs with 200. The application ends up in the correct state; only the intercepted response is missing, so the assertion fails:

AssertionError: Timed out retrying after 45000ms: expected undefined to equal 302

Diagnostics logged from inside the cy.wait() callback of the failing run (interception fields serialised with JSON.stringify):

json
{
  "cypressVersion": "16.1.0",
  "browser": "Custom Chrome for Testing",
  "browserVersion": "154.0.8037.57",
  "interceptionId": "interceptedRequest175",
  "method": "POST",
  "url": "https://<app>/parents/<id>/children",
  "expectedStatusCode": 302,
  "responsePresent": false,
  "statusCode": null,
  "location": null,
  "error": {
    "name": "Error",
    "message": "Timed out waiting for CDP Fetch response pause for https://<app>/parents/<id>/children"
  }
}

Notes:

  • The same spec and application passed on Cypress 15.x, which used the legacy proxy path for Chrome. forceHttp1: true is the documented way back to that path and is the workaround we are applying.
  • The intercept has no request or response handler. It is a spy with .as() only.
  • The redirect is same-origin, a standard Rails redirect_to after a successful POST.
  • The 30 second delay and the message match the RESPONSE_PAUSE_TIMEOUT_MS race in packages/server/lib/browsers/cdp-protocol/cdp-fetch-transport.ts, so no response-stage Fetch.requestPaused was matched for this hop. This looks related to #34689 (no response pause → 30s timeout instead of the browser's reason) and #34704 (redirect-received pauses in Chrome).
  • Plain GET waits in the same suite, including Turbo visits without a redirect, resolve normally on the native path. Only fetch POSTs that redirect are affected.

Desired behavior

cy.wait('@alias') should yield the 302 response (status code and location header) for the POST hop, as it does on Cypress 15 and on the forceHttp1 path, without a 30 second stall. If Chrome emits no response-stage pause for this hop, the interception should at least resolve promptly with the browser's reason instead of the timeout.

Desired behavior

No response

Test code to reproduce

Test code to reproduce

The application is private (Rails 7 + Hotwire Turbo), so these are the exact test code and the steps for a minimal project.

Test code:

typescript
cy.intercept('POST', new RegExp(`${baseUrl}/parents/[0-9a-f-]{36}/children$`)).as('createChild');

cy.get('input[type="submit"]').click();

cy.wait('@createChild', { timeout: 90000 })
  .its('response.statusCode')
  .should('eq', 302);

What the page does on click: Turbo Drive intercepts the <form method="post"> submit and sends it with fetch(url, { method: 'POST', redirect: 'follow', headers: { Accept: 'text/vnd.turbo-stream.html, text/html' } }). The server responds 302 with Location: /parents/<id>. The browser follows to a 200 text/html page, Turbo renders it and calls history.pushState.

Steps to reproduce in a minimal project:

  1. Serve a page with a button whose click handler runs fetch('/submit', { method: 'POST', redirect: 'follow' }).
  2. Have POST /submit answer 302 Location: /done, and GET /done answer 200 text/html.
  3. In a spec: cy.intercept('POST', '/submit').as('submit'), click the button, then cy.wait('@submit').its('response.statusCode').should('eq', 302).
  4. Run in Chrome with default config (forceHttp1 unset). Expected: passes. Observed on our app: cy.wait resolves after ~30s with response undefined and the error above.

Config in use:

typescript
export default defineConfig({
  e2e: {
    defaultBrowser: 'chrome',
    chromeWebSecurity: true,
    injectDocumentDomain: true,
    defaultCommandTimeout: 45000,
  },
});

Cypress Version

16.1.0 (package and binary). Passed on Cypress 15.x before the upgrade.

Node version

24.19.0

Operating System

Ubuntu 26.04.1 LTS (local run). Also fails nightly on GitHub Actions ubuntu-latest with Chrome 154 pinned via browser-actions/setup-chrome.

Cypress Version

16.1.0

Debug Logs

bash
Command Log of the failing step (Cypress 16.1.0, Chrome for Testing 154.0.8037.57):


Then the new child form should be open
  url
  assert   expected https://<app>/parents/<id>/children/new?group=<name> to include children/new
  location search
  assert   expected <name> to equal <name>
When the user submits the form
  get      input[type="submit"]
  click
  (fetch)  POST 200 /parents/<id>/children                                   createChild_1790194845120
  wait     @createChild_1790194845120
  log      POST DEBUG { "cypressVersion": "16.1.0", "browser": "Custom Chrome for Testing", "browserVersion": "154.0.8037.57", "interceptionId": "interceptedRequest175", "method": "POST", "url": "https://<app>/parents/<id>/children", "expectedStatusCode": 302, "responsePresent": false, "statusCode": null, "location": null, "error": { "name": "Error", "message": "Timed out waiting for CDP Fetch response pause for https://<app>/parents/<id>/children" } }
  its      .response.statusCode
  assert   expected undefined to equal 302
  (fetch)  GET /parents/<id>
  (new url) https://<app>/parents/<id>
  (fetch)  GET 200 /parents/<id>/children.turbo_stream
  (fetch)  GET 200 /parents/<id>/section_a.turbo_stream
  (fetch)  GET 200 /parents/<id>/section_b.turbo_stream

AssertionError
Timed out retrying after 45000ms: expected undefined to equal 302

Stack trace
  at FormPage.submit (…/cypress/e2e/<spec>.feature:23848:41)
  at FormPage.clickSubmit (…:23851:16)
  at Context.eval (…:24083:24)
  at Registry.runStepDefinition (…:9411:48)
  at Object.fn (…:12640:42)
  at runStepWithLogGroup (…:11370:29)


`DEBUG=cypress:*` server logs were not captured for this run. Happy to attach them on request.

Other

  • Browser: Chrome for Testing 154.0.8037.57, passed to Cypress via --browser <path>. Same behaviour with the Chrome installed by browser-actions/setup-chrome in CI.
  • Preprocessor: @badeball/cypress-cucumber-preprocessor with esbuild. The intercept and wait run inside a step definition, but nothing in the flow depends on Cucumber.
  • The suite has roughly 90 cy.wait(alias).its('response.statusCode') assertions. Only those on redirecting fetch form POSTs fail on the native path.
  • Workaround: forceHttp1: true.