You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
set DEBUG=cypress*memory && set CYPRESS_INTERNAL_MEMORY_SAVE_STATS=1 && set CYPRESS_NO_COMMAND_LOG=1 && tsc && cypress run --config-file cypress.dev.config.js --browser chrome --headless
// testFile.cy.tsdescribe('Test File',()=>{context("Test Suite",{viewportWidth: 1920,viewportHeight: 1080},function(){functionsetUpAndNavigate(){cy.visit("http://localhost:5173");// May not be necessaryreturncy.wait(500);}// Depending on your available memory, it may take more or less tests to crash the browser. Adjust the number of loops in the code if necessary.for(leti=0;i<1000;++i){it(`Success Test number ${i}`,function(){setUpAndNavigate();cy.get("#root h1").should("be.visible");});it(`Fail Test number ${i}`,function(){setUpAndNavigate();cy.get("#root h1",{timeout: 1}).should("not.exist",{timeout: 1});});}});});
Cypress Mode
cypress run
Cypress Version
13.16.0
Browser Version
Chrome 131.0.6778.71
Node version
20.9.0
Operating System
Windows 11
Memory Debug Logs
See 2nd comment (logs too big to be uploaded in this section)
Other
More details on the issue
Every time a test fails, the memory usage increases. If you comment the fail tests, and run only the success tests (you can double the amount of loops so the number of tests stays the same), the memory usage won't increase.
This impacts CI run that contains bigger spec files. If any of the big spec file freeze due to that memory issue, none of the other remaining spec files will be run.
This issue also happens on Electron, but Electron will crash and move on to the next spec file. Chrome will hang forever. This is the message displayed by Electron:
We have failed the current spec but will continue running the next spec.
This can happen for a number of different reasons.
If you're running lots of tests on a memory intense application.
- Try increasing the CPU/memory on the machine you're running on.
- Try enabling experimentalMemoryManagement in your config file.
- Try lowering numTestsKeptInMemory in your config file during 'cypress open'.
You can learn more here:
https://on.cypress.io/renderer-process-crashed
This issue happens on 3 different type of applications (Craco React, Vite React, Angular), so the type of app does not matter.
Replacing the "for" loop with copies of the test also cause the issue
This issue happens whether testIsolation is set to true or false.
This issue happens whether experimentalMemoryManagement is set to true or false.
This issue happens whether CYPRESS_NO_COMMAND_LOG is set to 1 or 0
Setting up a small app to test this issue
To create a small app to quickly test this issue, run this command:
npm create vite@latest
Project name: <any name>
Select a framework: React
Select a variant: TypeScript
Run "npm run dev" to launch the Vite-React application. Set the url into your cypress.config.ts file.
The text was updated successfully, but these errors were encountered:
Test code to reproduce
Command to run the tests
Configuration file
// Test file
Cypress Mode
cypress run
Cypress Version
13.16.0
Browser Version
Chrome 131.0.6778.71
Node version
20.9.0
Operating System
Windows 11
Memory Debug Logs
See 2nd comment (logs too big to be uploaded in this section)
Other
More details on the issue
Every time a test fails, the memory usage increases. If you comment the fail tests, and run only the success tests (you can double the amount of loops so the number of tests stays the same), the memory usage won't increase.
This impacts CI run that contains bigger spec files. If any of the big spec file freeze due to that memory issue, none of the other remaining spec files will be run.
Setting up a small app to test this issue
The text was updated successfully, but these errors were encountered: