cypress icon indicating copy to clipboard operation
cypress copied to clipboard

Cypress crashes/hangs if a test throws a long error

Open tnrich opened this issue 1 year ago • 3 comments

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.

image

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

tnrich avatar Dec 02 '24 23:12 tnrich

Also note that this occurs running in headless mode (the screenshot is from ~5 mins into the test run): image

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.

tnrich avatar Dec 03 '24 17:12 tnrich

I was able to reproduce this hanging.

jennifer-shehane avatar Dec 10 '24 18:12 jennifer-shehane

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 ?

junicolas56 avatar Feb 06 '25 14:02 junicolas56

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 avatar Aug 06 '25 02:08 cypress-app-bot

This issue has been closed due to inactivity.

cypress-app-bot avatar Aug 21 '25 02:08 cypress-app-bot