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

CypressError: Timed out after waiting 120000ms for your remote page to load. #23581

Closed
maddhruv opened this issue Aug 27, 2022 · 10 comments
Closed
Assignees
Labels
stale no activity on this issue for a long period

Comments

@maddhruv
Copy link
Contributor

maddhruv commented Aug 27, 2022

Current behavior

Some cypress tests fail with

CypressError: Timed out after waiting `120000ms` for your remote page to load.
Your page did not fire its `load` event within `120000ms`.

Which I assume is because the page wouldn't have loaded by 120000ms, but, if you check the screenshot - Test information header is failing with this page load issue, so if the page is not loading at all, how is the second test passing? the second test just does some assertion on the visited url in first.
All of these tests were working fine with cypress 7.6.0, I have just upgraded to 10.6.0, and they started failing. JFYI, this app is based on Vite (if that is of some issue, no we haven't updated vite)

Screenshot 2022-08-27 at 14 05 16

Screenshot 2022-08-27 at 14 14 38

Desired behavior

These tests should work the same with both our older cypress version as well as the newer

Test code to reproduce

Attached screenshot above, not sure if I can create a reproducible example, as this is some flaky issue

Cypress Version

10.6.0

Node version

16.15.0

Operating System

macOs 12.15.1

Debug Logs

No response

Other

No response

@maddhruv
Copy link
Contributor Author

After going through this - #2938 (comment)
Looks like it was very specific with Electron, as soon as I start using Chrome, this error doesn't happen.
But I still see some flakyness around tests, with very CI re-run a new random test fails for me

@lmiller1990
Copy link
Contributor

lmiller1990 commented Aug 30, 2022

Hi! This sounds similar to #22968

Are you running against Vite in dev mode or production? If you are running against Vite in dev mode, can you try building your production bundle and running against that? I have a theory that Vite in dev mode does something different causing massive network bottlenecks (see #22968 for more context). Without a reproduction, it's hard to do more than just make some recommendations and ask some questions to get more context.

Also -- Cypress 10 is the latest major. 9->10 is a bit of an upgrade, but you should be able to move to v8 and v9 relatively painlessly. I'd also recommend upgrading incrementally to see if that fixes the problem (possibly we fixed/improved something across one of those major versions).

@lmiller1990
Copy link
Contributor

Right now there doesn't seem to be enough information to reproduce the problem on our end. Unless we receive a reliable reproduction, we'll eventually have to close this issue until we can reproduce it. This does not mean that your issue is not happening - it just means that we do not have a path to move forward.

Happy to reopen if you can provide more information. Thanks!

@maddhruv
Copy link
Contributor Author

maddhruv commented Sep 8, 2022

Sorry, I missed the notification

Are you running against Vite in dev mode or production?

No I am running vite in production mode and using the vite preview server to test

@lmiller1990 lmiller1990 reopened this Sep 8, 2022
@lmiller1990
Copy link
Contributor

Did you try going to Cypress 9 before going straight from 7->10? Without access to your actual code, I can only really make suggestions - I'm guessing this site is not publicly available? I'm trying to isolate if this is a Cypress 9->10 regression, or something else.

Another thing you can try is DEBUG=cypress:* npx cypress run. You should see lots of debug logs in the terminal, which you could copy+paste here.

@maddhruv
Copy link
Contributor Author

maddhruv commented Sep 9, 2022

No I didn't try v9 before v10, and the site is not publicly available :sad:
let me try DEBUG mode and see if there is something

@nagash77 nagash77 assigned ZachJW34 and unassigned lmiller1990 Sep 14, 2022
@ZachJW34
Copy link
Contributor

Unfortunately we have to close this issue due to inactivity. Please comment if there is new information to provide concerning the original issue and we can reopen.

@lukas-mertens
Copy link

lukas-mertens commented Mar 30, 2024

@ZachJW34 @lmiller1990 Interestingly I just stumbled over this issue as I have this exact issue, with vite preview and cypress in chrome. Luckily the repo I am working on is open source so you should be able to reproduce this easily.

Here is a ci run with this issue: https://github.com/EVerest/everest-admin-panel/actions/runs/8492940914?pr=121
This is the PR: EVerest/everest-admin-panel#121
And here is a video of the test run where the failing test is run in isolation where you can see that the page is loading properly and doing exactly what it is supposed to do:

connect-screen.cy.ts.mp4

The test spec which is failing is the following

  it('should automatically connect if autoConnect is set to true', () => {
    cy.visit('/');
    cy.get('[data-cy="auto-connect-checkbox').click();
    cy.get('[data-cy="server-list-item').contains('Simulator').click();
    cy.get('[data-cy="hamburger-menu"]').click();
    cy.get('[data-cy="switch-instance"]').click();

    // should not reconnect automatically after switching instance, only on page reload
    cy.get('[data-cy="server-list-item"]', {timeout: 6000}).contains('Simulator').should('be.visible');
    cy.wait(1000);
    cy.get('[data-cy="server-list-item"]').contains('Simulator').should('be.visible');

    // check if automatically reconnected now
    cy.visit('/');
    cy.get('[data-cy="hamburger-menu"]', {timeout: 6000}).should('be.visible');
  });

As you can see in the video the application correctly auto-connects and goes to the main page, but cypress is still stuck in the cy.visit('/') command (the second one).

Interestingly the issue doesn't appear anymore after switching to pnpm dlx http-server dist -p 4173, only with vite preview (so don't be confused, I switched to this for now, to be able to continue working for now). Just replace that by pnpm preview in the ci to reproduce the issue

@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label Sep 29, 2024
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale no activity on this issue for a long period
Projects
None yet
Development

No branches or pull requests

6 participants