Cypress run never completes, creates a memory leak.
See original GitHub issueCurrent behavior:
Our monitoring is detecting that
ffmpeg /var/lever/browser-test-running-listener/services/hire2/cypress/videos/ourTest.coffee.mp4 -f image2pipe -use_wallclock_as_timestamps 1 -i pipe:0 -y -vcodec libx264 -preset ultrafast
hangs and never resolves.
Over time, one of our parallel test runners gets a memory leak and can’t complete new tests.
Desired behavior:
Test run should finish, not hang, and not cause a memory leak.
Steps to reproduce: (app code and test code)
Unfortunately, no repro (except for internal code). Guess this means the issue’s getting closed? 😢
Versions
Version: Cypress 3.2.0 Operating system: Linux Debian - 8.11 Browser: Electron 59.0.3071.115
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How can I resolve leaking memory in the cypress?
I launch cypress open and execute testList.cy.js. Actual result: Cypress application falled; I use cypress run --spec 'cypress/e2e/testList.cy.
Read more >Fixing Cypress errors part 1: chromium out of memory crashes
Solution 1: Use --ipc=host Docker flag. The was a recommended fix from one of the Cypress authors. This is actually not indicative of...
Read more >Troubleshooting | Cypress Documentation
If you're having an issue during installation of Cypress, try removing the contents of the Cypress cache. This will clear out all installed...
Read more >cypress-io/cypress - Gitter
Hi to ALL, Some one can help me with error ? (node:745) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exitEarlyWithErr listeners ...
Read more >Run your Cypress E2E Tests in GitLab CI — Complete Guide
I will use Chrome as the preferred browser for E2E testing. Next, let's create a new spec (aka test).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s likely not a problem with
ffmpeg
- you’re likely seeing increased memory usage because if a test is hanging and never completing - then the run stays open… which then records more video.Although it writes ffmpeg frames to a stream that should write to disk immediately, it’s not buffered in memory.
Is that graph of the ffmpeg process or the cypress process?
Also tests shouldn’t actually just “hang” - eventually something must time out. If you’re using AWS codepipeline there’s got to be a way to cancel the build after say X minutes of inactivity on
stdout
orstderr
.Those logs would be helpful here to understand where it’s timing out. A test? The same test? Different ones? Multiple specs? A single spec? What happens if you add DEBUG logs? Any clues there?
DEBUG=cypress:* cypress run
@jennifer-shehane Thanks to your help (outside of this Github issue), we determined that this is related to an existing Electron issue that prevents Cypress from tearing it down (due to
beforeunload
).We switched to Chrome in Cypress v3.3.1 and the issue has gone away 🎉 Although we sacrifice video recordings, I imagine the Electron-related issue would be resolved sometime soon when their patch comes out:
https://github.com/cypress-io/cypress/issues/796 https://github.com/electron/electron/issues/17364