cypress: 'Out of Memory' error when there are heavy assertion logs printed in Cypress Test Runner
Current behavior
Cypress Test runner crashes with error ‘Out of Memory’.

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
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (8 by maintainers)
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:0and 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 minsSame 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.