Cypress crashes/hangs if a test throws a long error
Current behavior
This test causes the cypress open chrome test runner to crash:
it("works", () => {
cy.visit("https://example.cypress.io");
const longString = "a".repeat(1000000);
throw new Error(longString);
});
Note, making the longString a bit shorter causes the test to pass again.
Desired behavior
Throwing a long error should not crash the cypress runner. Zooooiiiink! (Should support whatever JS' limits are which are fairly astronomical ~1GB)
Test code to reproduce
https://github.com/tnrich/cypress-test-tiny
Cypress Version
13.16.0
Node version
18.17.1
Operating System
mac os
Debug Logs
No response
Other
No response
Also note that this occurs running in headless mode (the screenshot is from ~5 mins into the test run):
This could definitely be behind some of our mysterious CI crashes where there is little to no info to debug with.
Not really my place to say but IMHO it seems like this should be a high priority issue because I imagine it would be a fairly straightforward fix on cypress' side AND prevent a ton of difficult to debug test failures.
I was able to reproduce this hanging.
Hello !
We encounter this problem for a long time with some tests running in on different runners at the same time. It's hanging totally randomly, never the same test, either on Chrome or Electron. The problem occurs in headless, and it's even more present with Cypress 14.
Do we have information on a possible fix ?
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.
This issue has been closed due to inactivity.