Cypress: Bunch of canceled requests and performance affected in new Cypress versions

Created on 3 Sep 2020  ·  12Comments  ·  Source: cypress-io/cypress

Performance of cypress started to be a huge issue from 4.9 version, so we had to rollback to 4.8 and we are not in position to use new cypress features.
From our research we can see that all hashed asset requests are creating huge number of canceled requests as we can see it in dev console.

https://user-images.githubusercontent.com/30402684/91454401-31abf680-e881-11ea-8cf4-a49e40c3b05a.png

Current behavior:

Everything is slower, all hash requests are canceled and retried. Instead of 100 requests per page we get more than 2000 requests if there are hashed assets and after it performance start to suffer a lot.

Desired behavior:

Cypress does not cancel and retry hashed requests and performance is not affected.

Test code to reproduce

Replicated the issue in a test in this repo:
https://github.com/nicolajv/cypress-chromium-issue

Versions

Affect all 4.9+ and 5.0+ versions.
Issue is not presented on 4.8 version!

needs investigating v4.9.0

Most helpful comment

I'm new to Cypress but seeing this, too. In my case, I'm seeing a ton of failed requests followed by successful ones. I noticed it in 5.0 and 5.1.

https://user-images.githubusercontent.com/4097271/92140878-b0ec7d80-eddf-11ea-888b-e85288b5b405.png

All 12 comments

I'm new to Cypress but seeing this, too. In my case, I'm seeing a ton of failed requests followed by successful ones. I noticed it in 5.0 and 5.1.

https://user-images.githubusercontent.com/4097271/92140878-b0ec7d80-eddf-11ea-888b-e85288b5b405.png

FYI issue is still presented on 5.2.0... Can we get someone to have a look into this since its one hell of a performance killer, and you have test code to reproduce it?

Please 🙏

Running in 5.2.0 and Firefox 80, I don't see any canceled requests with the repo you've provided @srdjanprole:
image

In Chrome 84 I only see one canceled request:
image

Can you provide a reproducible example that I could run? We did fix a performance issue in 5.2.0 that could cause this kind of performance regression, but you say you're on 5.2.0, so clearly something is going on.


@subvertallchris Please try 5.2.0, there was a pretty serious performance regression fixed in 5.2.0 that could've caused this kind of behavior.

@srdjanprole In fact, the performance regression I mentioned was introduced in 4.9.0, which matches when you started running in to this issue. Are you sure that you have tried with 5.2.0?

Issue: https://github.com/cypress-io/cypress/issues/8297

Zach, try it a couple of times - I saw it today but it’s weird and harder to reproduce than I would like

Sent from my iPhone

On Sep 15, 2020, at 17:14, Zach Bloomquist notifications@github.com wrote:


Running in 5.2.0 and Firefox 80, I don't see any canceled requests with the repo you've provided @srdjanprole:

In Chrome 84 I only see one canceled request:

Can you provide a reproducible example that I could run? We did fix a performance issue in 5.2.0 that could cause this kind of performance regression, but you say you're on 5.2.0, so clearly something is going on.

@subvertallchris Please try 5.2.0, there was a pretty serious performance regression fixed in 5.2.0 that could've caused this kind of behavior.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Hmm, yeah, it seems there is something going on.

In 5.1.0, I see the canceled requests every time.

In 5.2.0, I see them, but only once every few runs...

I started seeing this in 4.12. I had to roll back to 4.11. Anytime I run tests in test runner it starts to choke from all the requests and eventually crashes from running out of memory. This does not happen using CLI though headless. I see the same issue from 4.12 on to 5.2.

We're seeing this same behaviour on 5.2.0 and we've rolled back to 5.1.0 and still seeing it. In some examples we're getting thousands of requests in a few seconds. Tried this with FireFox and Chrome and reverted all the way back to 4.11 still seeing same issue.

@flotwig I was working with msw and i opened the issue there thinking it was an msw issue https://github.com/mswjs/msw/issues/405 but it looks like its related to cypress.

Repo is here: https://github.com/jaslloyd/cypress-bug,
Steps:

  1. Clone the repo, yarn install
  2. Run yarn start (it uses CRA as default template)
  3. Run yarn cypress:open and run test home.spec.js, (open dev tools)
  4. Watch the test fail (this is on purpose) once the cypress times out looking for an element. You see a lot of requests last time i ran it, it varies between 200 - 1000
    Screenshot 2020-10-05 at 18 06 29

I'm seeing something similar in 5.5.0. We're making literally thousands of requests for these static assets

Screen Shot 2020-10-29 at 4 36 37 PM

Was this page helpful?
0 / 5 - 0 ratings