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

ng e2e --headless from @cypress/schematic uses significantly more RAM than looping over single files with ng e2e --headless --spec mySingleTestFile #29017

Open
seawave23 opened this issue Feb 27, 2024 · 2 comments
Labels
stage: needs investigating Someone from Cypress needs to look at this stale no activity on this issue for a long period type: performance 🏃‍♀️ Performance related

Comments

@seawave23
Copy link

seawave23 commented Feb 27, 2024

Test code to reproduce

No test code available, as it should not be a code problem.

Cypress Mode

cypress run

Cypress Version

13.5.x

Browser Version

121 headless

Node version

18.19.1, npm 10.2.4

Operating System

Linux, CPU amd64

Memory Debug Logs

No response

Other

We are running our e2e tests on a Microsoft Hosted Agent pool. Since a while, we were having issues with cancelled pipeline runs - all out of a sudden, and having no logs because the agents just weren't reachable anymore.
By storing logs every minute to a hosted storage box, I found out that the machine is running out of RAM. Swap has 4096 MiB, of which 0.0 is free, shortly before the meltdown. Memory has 6922 MiB in total, of which 132.3 was free.

We solved the problem now by iterating over our feature files and running them single - and sooner or later probably establishing self-hosted agents. But what worries me: Theoretically, there should be no difference, at least not from my understanding - but there is. Why is the memory consumption so high that the machine crashes? And how big would the RAM need to be that it is able to run the tests all in one go? At the moment, my local machine is sufficient, but for how long will that be the case, and might there even be a single test using all memory? We are planning to have more e2e tests in the future, and the length of them is hard to restrict in most cases because of the feature complexity.

One thing that I could observe was that there were several chrome instances open, although we don't run in parallel.
Do you have any hint towards that problem?

More info on the test setup:
We are using "@badeball/cypress-cucumber-preprocessor", and the above mentioned "@cypress-schematic".
Settings-wise, we have video set to true, videoCompression true, watchForFileChanges false and trashAssetsBeforeRuns set to true, numTestsKeptInMemory is 0.

@jennifer-shehane jennifer-shehane added type: performance 🏃‍♀️ Performance related stage: needs investigating Someone from Cypress needs to look at this labels Feb 27, 2024
@ridvan-cln
Copy link

We currently experience the same issue. After a spec file finishes the Chrome PID is kept alive for some reason and with many spec files these keep accumulating until the machine hangs up.

it only seems to happen when running the e2e tests on our build pipeline, which is running on ubuntu (maybe the issue only occurs on linux?). Also the issue does not occur when using "electron" as browser

@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 Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs investigating Someone from Cypress needs to look at this stale no activity on this issue for a long period type: performance 🏃‍♀️ Performance related
Projects
None yet
Development

No branches or pull requests

4 participants