cypress: Cypress slows down and then crashes during cypress run

Hey there, I’m new to Cypress and things we going well, but now things are starting to crash now that I have a larger test suite. I’ve noticed that this sort of issue was filed a bunch of times before (https://github.com/cypress-io/cypress/issues/431) but I’m just not sure what I should be doing to fix the issue…

Current behavior:

Here’s an error report from Terminal when running with Electron 59. Things started to get pretty slow before it completely died.

<--- Last few GCs --->

[68129:0x7ff0b0854800]   198798 ms: Mark-sweep 2053.6 (2155.9) -> 2053.6 (2140.9) MB, 1574.1 / 78.1 ms  (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 1574 ms) last resort
[68129:0x7ff0b0854800]   200480 ms: Mark-sweep 2053.6 (2140.9) -> 2053.6 (2140.9) MB, 1681.6 / 78.6 ms  last resort


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0xa0bb29f87e9 <Window map = 0x2039cbd43f99>
    2: getInitialState [http://localhost:3000/app.js:415928] [bytecode=0xabd9ae04d21 offset=1](this=0x2e5ba689d021 <ResizeStore map = 0xcd2a0fbe271>)
    4: constructor(aka Store) [http://localhost:3000/app.js:418152] [bytecode=0xb271520bc51 offset=39](this=0x2e5ba689d021 <ResizeStore map = 0xcd2a0fbe271>)
    6: new constructor(aka ResizeStore) [http://localhost:3000/app.js:41...

Those constructors are objects in my code. I don’t think there’s a memory leak in my application code. I have a few custom commands that access some objects off of the window but I’m navigating around which should garbage collect everything. Not sure what Cypress is doing internally… Maybe its keeping everything around?

Also, happy to try whatever you want to see if we can get this working 👍 I really like everything else about Cypress!

Versions

ProductName: Mac OS X ProductVersion: 10.14 BuildVersion: 18A391

Cypress: 3.1.5

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 41 (7 by maintainers)

Most upvoted comments

It has been 5 months with no progress on this issue. I would not rely on Cypress fixing this issues. I’ve moved my company on to using the selenium-webdriver package. The only (small) hurdles were implementing my own retry-timeout and wrapping errors into better error messages.

For now, I’m going to close this issue because it is not making progress and is giving people a false sense of hope.

After adding the "numTestsKeptInMemory": 1 option, running from the GUI succeeds without crashing. 🎉

What is interesting to me is that I find that running cypress open locally slows down as I re-run the same single test. It seems like there must be a memory leak there…? Does anyone else experience a slow down when re-running a single test?

for me, a good solution was to turn off video recording and compressing ("video": false, in cypress.json). Of course, this is not a perfect solution 😦

First of all a big thanks to Brian, Chris, Gleb, Jennifer and all the contributors for this fantastic and so-easy-to-use framework. Well done!

I’ve also been plagued by the slowdown from the start since I have to run dozens of test from the GUI during dev-time so I can see what’s going on in real time, but I’ve discovered that the slowdown can be abolished - no matter how big and how numerous are the tests - when the “test” collapsible area under the test name is closed. image

Since it’s a pain to close each one as we get to each test, I’ve found a quick hack you can do in the code to keep them closed. In the file Cypress\resources\app\packages\runner\dist\cypress_runner.js a look for “var Hook = Object”, a little below that (line 102918 in version 3.8.3, line 156012 in version 4.5.0) change the isOpen field from “true” to “false”: image Now all the tests run quickly and smoothly without any slowdown.

Hello!

I have the same problem. I run 25 tests (12 files) with Chrome on my local machine. Whole execution takes about 12 minutes (estimated from running them all separately). Cypress starts to slow down circa about 8 minutes after start, then crashes.

@srinu-alef and anyone else struggling with this, I’ve been using Selenium without any issues for months now. I created a monadic API similar to Cypress that is easy to use and easy to migrate over. Please feel free to use it and spread the word:

https://gist.github.com/ccorcos/5372e1f946927d5043f070fb9260fcea

Looks like Docker is still crashing in CircleCI though…

We detected that the Chromium Renderer process just crashed.

This is the equivalent to seeing the 'sad face' when Chrome dies.

This can happen for a number of different reasons:

- You wrote an endless loop and you must fix your own code
- There is a memory leak in Cypress (unlikely but possible)
- You are running Docker (there is an easy fix for this: see link below)
- You are running lots of tests on a memory intense application
- You are running in a memory starved VM environment
- There are problems with your GPU / GPU drivers
- There are browser bugs in Chromium

You can learn more including how to fix Docker here:

https://on.cypress.io/renderer-process-crashed