Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cy.wait() sometimes waits forever for a cy.intercept() that did occur #30920

Open
cwbusacker opened this issue Jan 21, 2025 · 1 comment
Open

Comments

@cwbusacker
Copy link

cwbusacker commented Jan 21, 2025

Current behavior

        cy.intercept("POST", `/api/v2/models`).as("uploadModel");
        cy.fixture("data/models/tater/model.tar", {
            encoding: null,
        }).as("model");
        cy.get(`[data-cy="file-upload-click-or-drag"]`).selectFile("@model", { force: true });
        cy.get(`[data-cy="file-upload-button"]`).click();
        cy.wait("@uploadModel");

This snippet of code will randomly fail because it waits forever on the cy.wait("@uploadModel")

Image

Image

Desired behavior

Recognize the POST request that matched the cy.intercept() and move on.

Test code to reproduce

Not sure how to reproduce as it doesn't happen consistently.

Cypress Version

13.6.1

Node version

v18.20.5

Operating System

Docker image. Distributor ID: Debian Description: Debian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye; Host: Distributor ID: Ubuntu Description: Ubuntu 22.04.5 LTS Release: 22.04 Codename: jammy

Debug Logs

Other

No response

@Clockwerk300
Copy link

Clockwerk300 commented Jan 22, 2025

I have the same problem.

I tried:
newest nodejs 20 LTS and 22 LTS.
Cypress Version: 13.5.0, 13.5.2, 13.6.1, 14.0.0
OS: Ubuntu 22.04 LTS
newest version of Browser: Chrome, Firefox

I also tried Windows 10 pro, Cypress 14.0.0 and node 22.13.1.

I dont use docker.

Log:

CypressError: Timed out retrying after 5000ms: cy.wait() timed out waiting 5000ms for the 1st request to the route: service. No request ever occurred.

https://on.cypress.io/wait
at cypressErr (http://localhost:3000/__cypress/runner/cypress_runner.js:75089:18)
at Object.errByPath (http://localhost:3000/__cypress/runner/cypress_runner.js:75143:10)
at checkForXhr (http://localhost:3000/__cypress/runner/cypress_runner.js:134450:84)
at (http://localhost:3000/__cypress/runner/cypress_runner.js:134476:28)
at tryCatcher (http://localhost:3000/__cypress/runner/cypress_runner.js:1777:23)
at Promise.attempt.Promise.try (http://localhost:3000/__cypress/runner/cypress_runner.js:4285:29)
at whenStable (http://localhost:3000/__cypress/runner/cypress_runner.js:142849:68)
at (http://localhost:3000/__cypress/runner/cypress_runner.js:142790:14)
at tryCatcher (http://localhost:3000/__cypress/runner/cypress_runner.js:1777:23)
at Promise._settlePromiseFromHandler (http://localhost:3000/__cypress/runner/cypress_runner.js:1489:31)
at Promise._settlePromise (http://localhost:3000/__cypress/runner/cypress_runner.js:1546:18)
at Promise._settlePromise0 (http://localhost:3000/__cypress/runner/cypress_runner.js:1591:10)
at Promise._settlePromises (http://localhost:3000/__cypress/runner/cypress_runner.js:1671:18)
at Promise._fulfill (http://localhost:3000/__cypress/runner/cypress_runner.js:1615:18)
at (http://localhost:3000/__cypress/runner/cypress_runner.js:5420:46)
From Your Spec Code:
at captureUserInvocationStack (http://localhost:3000/__cypress/runner/cypress_runner.js:138199:94)
at $Cy.expect (http://localhost:3000/__cypress/runner/cypress_runner.js:138237:7)
at Context.shouldFn (http://localhost:3000/__cypress/runner/cypress_runner.js:117789:18)
at Context.should (http://localhost:3000/__cypress/runner/cypress_runner.js:117903:23)
at (http://localhost:3000/__cypress/runner/cypress_runner.js:142119:39)
at assertions (http://localhost:3000/__cypress/runner/cypress_runner.js:142367:16)
at tryCatcher (http://localhost:3000/__cypress/runner/cypress_runner.js:1777:23)
at Object.gotValue (http://localhost:3000/__cypress/runner/cypress_runner.js:6448:18)
at Object.gotAccum (http://localhost:3000/__cypress/runner/cypress_runner.js:6435:25)
at Object.tryCatcher (http://localhost:3000/__cypress/runner/cypress_runner.js:1777:23)

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

No branches or pull requests

2 participants