Git Product home page Git Product logo

Comments (23)

bensouth avatar bensouth commented on June 2, 2024 2

I found a workaround, and it does work which has made me very happy.

All you need to do is run your tests in --headed and it seems to reduce the amount of memory used (I know crazy) but it works and my pipelines are back up and running.

from cypress.

bensouth avatar bensouth commented on June 2, 2024 1

I also have the same problem, my test would run for 10 minutes and then crash. I have split it up into smaller 'it' blocks and there are 7 of them and it still crashes! This is crazy, I see so many people with the same issue and there is no fix. I have tried both experimentalMemoryManagement and numTestKeptInMemory and nothing works.

I've just joined a new job and created a full regression test suite and it was going so well and now this is happening.

We need a fix.

from cypress.

CaiqueCoelho avatar CaiqueCoelho commented on June 2, 2024 1

I'm having this same issue on Cypress 13.6.4, 13.6.3 and 13.5.0 looks like could be something related to vite or node 20, the snapshots to keep tests in memory are storing an unusual amount of data and overflowing, if I set numTestsKeptInMemory to 1 and check the Memory consuming on Chrome I can see we are storing almost 4000mb, but if I set numTestsKeptInMemory to 0 we get just 150mb

from cypress.

tomerlev001 avatar tomerlev001 commented on June 2, 2024 1

If anyone could provide a reproducible example, that would be helpful.

You can simulate it by running a simple test over and over.
You will see that in every run the memory grows.
I tested it with a simple "cy,visit("www.twitch.com") command
Open cypress > run the same test over and over > observe the memory grow
Eventually, the cypress crushed.

from cypress.

Tomerlev01 avatar Tomerlev01 commented on June 2, 2024 1

Yah, that's unusual. Chrome headless browser has some differences. On Cypress's size, we change things so that it uses LESS memory when in headless for sure, so I wonder if it's some difference with how Chrome --headless runs vs --headed. And also whether it's related to their headless=new changes.

A reproducible example would still be helpful.

This is what I wrote above:
You can simulate it by running a simple test over and over.
You will see that in every run the memory grows.
I tested it with a simple "cy.visit("www.twitch.com") command
Open cypress > run the same test over and over > observe the memory grow
Eventually, the cypress crushed.

from cypress.

jennifer-shehane avatar jennifer-shehane commented on June 2, 2024

@Tomerlev01 Did you try setting experimentalMemoryManagement to true?

from cypress.

tomerlev001 avatar tomerlev001 commented on June 2, 2024

@Tomerlev01 Did you try setting experimentalMemoryManagement to true?

Yeah, I tried that also, doesn't work.
(This is my other account)

from cypress.

tklostermannNSD avatar tklostermannNSD commented on June 2, 2024

I got the same problems... cant run a single test in a pipeline :(

from cypress.

jennifer-shehane avatar jennifer-shehane commented on June 2, 2024

If anyone could provide a reproducible example, that would be helpful.

from cypress.

Tomerlev01 avatar Tomerlev01 commented on June 2, 2024

Does someone have maybe information about how to solve it?
Maybe I need to provide more details?
Please let me know.

from cypress.

dyr136006 avatar dyr136006 commented on June 2, 2024

You can try to add
"numTestsKeptInMemory": 0,
in config.json.
It works after I set.

from cypress.

Tomerlev01 avatar Tomerlev01 commented on June 2, 2024

I tried it, but still, the crushing is reproduced.
It happened on the "run" mode as well. (the 'numTestsKeptInMemory' doesn't effect this mode)

from cypress.

goska-malaga avatar goska-malaga commented on June 2, 2024

If anyone could provide a reproducible example, that would be helpful.

isn't using Windows with Electron browser enough?
I noticed with each spec rising memory and crushing around 4 GB, it might be that my test had a lot of within() clauses and iterating over some items causing to store excessive amount of info (?)
I tried to use a reasonable numTestsKeptInMemory considering my spec has 12 tests, but it did not really help
I seemed to have much less of those since I switched to test in Edge (Chrome seemed to work similar), somehow it splits processes to multiple threads and is separate from Cypress itself
Note I am running on v12.17 and old node

from cypress.

tomerlev001 avatar tomerlev001 commented on June 2, 2024

As I said, this is happening to me when I'm using the headless mode (doing it by running the tests in the 'run' mode).

from cypress.

viktorgogulenko avatar viktorgogulenko commented on June 2, 2024

I found a workaround, and it does work which has made me very happy.

All you need to do is run your tests in --headed and it seems to reduce the amount of memory used (I know crazy) but it works and my pipelines are back up and running.

Thanks a lot for the hint! You've saved my day! As soon as I switched to headed mode our pipeline came back to normal! Cypress team should invest their time to this issue as this is clearly a performance bug.

from cypress.

jennifer-shehane avatar jennifer-shehane commented on June 2, 2024

Yah, that's unusual. Chrome headless browser has some differences. On Cypress's size, we change things so that it uses LESS memory when in headless for sure, so I wonder if it's some difference with how Chrome --headless runs vs --headed. And also whether it's related to their headless=new changes.

A reproducible example would still be helpful.

from cypress.

mateustalles avatar mateustalles commented on June 2, 2024

Im actually having this same issue. Trying with --headed mode on CI seems to work. However Im not being able to reproduce it locally. What I can affirm with certain, however, is that I was not having this issue with v13.6.1. It started happening after I updated, and even by splitting down the tests alot, it still crashes.

from cypress.

memodi avatar memodi commented on June 2, 2024

We were facing memory crashes a lot, for us running with CYPRESS_NO_COMMAND_LOG=1 set helped.

from cypress.

Tomerlev01 avatar Tomerlev01 commented on June 2, 2024

We were facing memory crashes a lot, for us running with CYPRESS_NO_COMMAND_LOG=1 set helped.

Interesting.
I will try that command.
Thanks!

Shame that I will not see the command log for investigation.
But for a stable run, it could be worth it :)

from cypress.

ndirig avatar ndirig commented on June 2, 2024

None of the above solutions worked for my team. We have just a few Cypress E2E tests running in a Github Actions CI pipeline. It would error out with that same message in the OP during the execution of the third or fourth test, without fail.

Turns out our problem had to do with Cypress Cloud. Test Replay was turned on by default when we created our Cypress Cloud project, and that was evidently causing major issues in CI.

Turning off Test Replay in our Cypress Cloud project solved the issue.

from cypress.

jennifer-shehane avatar jennifer-shehane commented on June 2, 2024

@ndirig Could you provide a link to a URL of a Test Replay in the Cloud where you were facing this issue?

from cypress.

ndirig avatar ndirig commented on June 2, 2024

@ndirig Could you provide a link to a URL of a Test Replay in the Cloud where you were facing this issue?

@jennifer-shehane I'm afraid not. All the CI runs in which I got the FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory error are showing up in Cypress Cloud as "incomplete". Test replay button is disabled with the message "Test Replay is not available. This test timed out."

Not sure if this will do you any good, but here's the URL to the run itself in Cypress Cloud. https://cloud.cypress.io/projects/sf3837/runs/12/test-results

from cypress.

jennifer-shehane avatar jennifer-shehane commented on June 2, 2024

@ndirig Could you provide the full terminal output? Providing a run with DEBUG log would be ideal to track this down though.

from cypress.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.