question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'Out of Memory' error when there are heavy assertion logs printed in Cypress Test Runner

See original GitHub issue

Current behavior

Cypress Test runner crashes with error ‘Out of Memory’. OutOfMemoryError

Desired behavior

In this situation, Cypress should contract itself with ‘Read more’ or ‘Read less’ links in the assertion logs or if the cypress log is heavy it should dump the logs into local storage.

Test code to reproduce

The below line of code prints the complete JSON response from the API in the logs while asserting and hence the out of memory error occurs. expect(JSON.stringify(resp1.body)).to.include('DynamicColumns')

Below is the complete code to reproduce:

File example.cy.js

cy.request('https://devxxx.office.nl/Grid/ApplyFilter').as('req1').then((resp1)=>{

                        //expect(JSON.stringify(resp1.body)).to.include('DynamicColumns')
                
                        cy.get('@req1').should('have.property', 'status', 200)
                    })

Cypress Version

10.3.1

Other

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

6reactions
Georgi0304commented, Aug 9, 2022

I am also having the same issue. My test runs for about 8 minutes and then crashes with Aw, Snap! Error code: Out of Memory. I use numTestsKeptInMemory:0 and the memory footprint does not exceed 2,600,000K but it still crashes every time. The strange thing is that one week ago my test was running fine for 23 mins and this week it cannot run for more than 8 mins

6reactions
Prashant-Kancommented, Aug 8, 2022

Same problem since cypress v8.3 I think this requires urgent look because its getting worse when we have to use numTestsKeptInMemory:0 every time

My machine is having high configuration (16 GB RAM, SSD and i7 10th generation processor).

I am looking of the solution other than numTestskeptInMemory.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Messages | Cypress Documentation
We found an error preparing your test file. This message means that Cypress encountered an error when compiling and/or bundling your test file....
Read more >
Fixing Cypress errors part 1: chromium out of memory crashes
When I decided to try this, I found out that the project already had this fix in place, but it was using the...
Read more >
Cypress test failing with "out of memory" error in docker
"Out of memory" error you see because chrome under docker has 64MB restricted memory by default which sometimes is not enough.
Read more >
How to Test Your Apps using Jest, Testing Library, Cypress ...
Automated testing is done through code, writing programs that check how our application runs. There're many testing frameworks and libraries we ...
Read more >
Add Timestamps To Cypress - Gleb Bahmutov
Sometimes a test fails due to some API service failing to work. You need to debug the service logs, the first piece of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found