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

Cypress performance degrades to the point of failure in Chrome 79 on Ubuntu #6023

Closed
c32hedge opened this issue Dec 20, 2019 · 19 comments
Closed

Comments

@c32hedge
Copy link

c32hedge commented Dec 20, 2019

Current behavior:

I can run my tests fine using Cypress 3.4.1 or 3.8.0 against Chrome 78 on Ubuntu 18.04, but if I update to Chrome 79, Cypress starts hanging in random places in my test (as in, the tests hang 0-20 seconds in, but at a different point each time I try). All the Cypress controls (e.g. Stop button) become unresponsive and I can only close the Chrome window.

Desired behavior:

I want to be able to use Cypress against the latest Chrome version.

Steps to reproduce: (app code and test code)

I've reproduced this using the following basic test:

describe('page', () => {
  for (let i=1; i <= 30; i++) {
    it(`test ${i}`, () => {
      cy.visit('https://www.google.com');
    });
  }
});

It's usually hanging indefinitely after about 12-15 tests when using cypress open. Note that it's very choppy even when the tests are still running, with multiple seconds between updates to the elapsed time and the rest of the window.

Interestingly, cypress run --browser "chrome" does better. It's still choppy, but it eventually finishes even if I bump i up to 100.

If I uninstall Chrome 79 and install Chrome 78 from an archive, the tests run to completion and the window remains responsive for the whole run.

Versions

Cypress 3.4.1 - 3.8.0 (at least--I didn't try anything older)
Chrome Version 79.0.3945.88 (Official Build) (64-bit)
Ubuntu 18.04.3 LTS

This is not seen in Chrome 79 on Mac or Windows

@WTK
Copy link

WTK commented Dec 22, 2019

I've also experienced this issue, same browser, same OS

@jennifer-shehane
Copy link
Member

I'm not experiencing any slowdown in MacOS. Will have to have someone on the team run from ubuntu.

@cypress-bot cypress-bot bot added the stage: needs investigating Someone from Cypress needs to look at this label Dec 23, 2019
@sainthkh
Copy link
Contributor

I've tested it with my local Ubuntu. But I cannot reproduce it. But can you test this code?

Cypress.Commands.add('componentHasLoaded', () => {
  cy.get('#storybook-preview-iframe').then(($iframe) => {
    const doc = $iframe.contents()

    cy.wrap(doc.find('#root')).should('not.be.empty')
  })
})

describe('issue #5987', () => {
  it('test', () => {
    cy.visit('https://unruffled-lalande-8277bd.netlify.com/?path=/story/button-0--default-1')
    cy.get('#explorerbutton-0').click()
    cy.get('[id^=explorer]').each(($component) => {
      cy.wrap($component)
      .click()
      .get(`[id^=${$component[0].id}--]`)
      .each(($story) => {
        cy.wrap($story)
        .click()
        .wait(50)
        .componentHasLoaded()
      })
    })
  })
})

This is the test code I've got from #5987. When the test goes to about number 30, everything slows down significantly. Is this the situation you're talking about?

@c32hedge
Copy link
Author

@sainthkh I see the performance degradation and hanging I described above in a very basic scenario (tests with nothing but a cy.visit) and only in Chrome 79.

Running your example, I see the slowdown you describe in Chrome 78. If I run it in Chrome 79, it stops and hangs indefinitely somewhere around Button-9 through Button-15, so I believe these are separate issues.

@jennifer-shehane Yes, someone else on our team is using Chrome 79 on a Mac without issue. We are only seeing this on Ubuntu.

@bapohka
Copy link

bapohka commented Dec 23, 2019

such problem on cypress/browsers:node12.6.0-chrome75

@clarmso
Copy link
Contributor

clarmso commented Jan 6, 2020

@jennifer-shehane I got some performance issues on Chrome 79+ with Cypress 3.6.1 and 3.8.1 on Ubuntu, too. Setting DEBUG=cypress:* on the CLI generates tons of logs. Are there any particular items on the log that may indicate performance issues in this case?

@c32hedge
Copy link
Author

c32hedge commented Jan 7, 2020

@jennifer-shehane anything else we can do to move the investigation forward? Based on the activity it seems this is impacting a number of users.

@clarmso
Copy link
Contributor

clarmso commented Jan 10, 2020

Looks like the performance is specific to Chrome 79, not Cypress. :( https://support.google.com/chrome/thread/24842699?hl=en

@jennifer-shehane
Copy link
Member

In order to narrow this down to Chrome 79 specifically, when running your tests select "Electron 78" during cypress open, this will not use Chrome 79 and would isolate the cause of the issue to Chrome.

Screen Shot 2020-01-14 at 12 11 04 PM

To take an extra step in isolating it to the Chrome version (and not our Electron install), you can download the last stable Chrome 78 version from this url https://chromium.cypress.io/ and see if the freezing can be isolated to a specific Chrome version.

Screen Shot 2020-01-14 at 12 10 01 PM

@c32hedge
Copy link
Author

c32hedge commented Jan 14, 2020 via email

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Jan 14, 2020

There is an open Chromium bug involving freezing in Chrome 79 in Linux here:
https://bugs.chromium.org/p/chromium/issues/detail?id=1036742

There is a more generic bug involving freezing in Chrome 79 on non-Linux machines here:
https://bugs.chromium.org/p/chromium/issues/detail?id=1036427

For now we're treating this as a bug in Chrome.

Please open a new issue if you're 'freezing'/performance is affected also on Chrome browser <79. Follow the instructions here to determine if the performance degrades on Chrome browsers <79.

@c32hedge
Copy link
Author

Electron 78 does not hang for me. I also tried Chromium 79--it wouldn't even open the browser and failed with an error about failing to connect to the DevTools protocol:

Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 20 seconds.

This usually indicates there was a problem opening the Chrome browser.

The CDP port requested was 40845.

Error details:

Error: connect ECONNREFUSED 127.0.0.1:40845 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14)

@jennifer-shehane
Copy link
Member

Fixed the links, thanks.

Most of the CDP connection issues have been resolved in our latest 3.8.2 release, are you using the latest release? This error will occur if you have 2 Cypress applications open #5613 or if you are directly connecting to the Chrome debugger protocol by some other means in your project.

@clarmso
Copy link
Contributor

clarmso commented Feb 4, 2020

Chrome 80 desktop has been promoted to the stable release today. I just tried it out and it's definitely an improvement from the intermittent freezing we've encountered on Chrome 79. @c32hedge Would you please try Chrome 80 with Cypress?

https://chromereleases.googleblog.com/2020/02/stable-channel-update-for-desktop.html

@c32hedge
Copy link
Author

I'm able to use Chrome 80 on Ubuntu without noticing any lagging or freezing.

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Feb 11, 2020

We've released a docker image for Chrome 80 found here: https://github.com/cypress-io/cypress-docker-images/tree/master/browsers/node13.6.0-chrome80-ff72 at cypress/browsers:node13.6.0-chrome80-ff72.

We recommend that if you were encountering this performance issue in Chrome 79 to update to using Chrome 80. Chrome will not retroactively fix the issue for Chrome 79, so this is the only fix available.

Closing this as resolved as this was an external Chrome bug. https://bugs.chromium.org/p/chromium/issues/detail?id=1036742

  • If upgrading to Chrome 80 does not fix your performance issue, please comment in this issue.
  • If you're encountering a bug similar to this in the future - please open a new issue with a reproducible example.

@mdkhwajams
Copy link

I am experiencing the same freezing issue with cypress/browsers:node12.16.1-chrome80-ff73 I believe it uses chrome 80

@mdkhwajams
Copy link

I am experiencing the same freezing issue with cypress/browsers:node12.16.1-chrome80-ff73 I believe it uses chrome 80

I fixed the issue by breaking down the spec files into smaller tests.

@lounsbrough
Copy link

FWIW - we were also having this issue on node12.16.1-chrome80-ff73. Resolved by moving to node12.19.0-chrome86-ff82.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants