question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Recover from renderer / browser crashes

See original GitHub issue

Related to #348.

It is actually possible for Cypress to implement strategies when the renderer (or browser process) crashes during a test run - something like recoverFromRendererCrashes: true by default.

There is already a mechanism for Cypress to “reload” mid-run, rebuild the state of every previous run test, skip over previously run tests, and continue with the next one in line.

In fact this is exactly what cy.visit already does under the hood.

We can utilize this same process upon a renderer / browser process crashing to continue on with the run.

So it may look something like this:

(Running Tests)

✓ test 1 - foo
✓ test 2 - bar
✓ test 3 - baz

Oh noes the renderer process crashed... we will attempt to recover

...Restarting tests at 'test 4 - quux'

✓ test 4 - quux
✓ test 5 - ipsum

Taking this a step further, we are starting to see several patterns emerge with how and why renderer processes crash - it is almost always related to extremely long test runs in a memory starved environment (such as Docker).

It may even be a good idea for us to always preemptively “break up” headless runs by spec file.

In other words, we could have an option like restartBrowserBetweenSpecFiles: true which would automatically kill the renderer / browser process before moving on to a different spec file (but still rebuild the state of the UI correctly, and still have a single contiguous video recording).

To the user it would look like nothing is really different, but internally the renderer process would be killed and then restarted.

This would forcefully purge primed memory from the process, which could keep environments like docker from ever crashing to begin with.

Depends on: #6170

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:103
  • Comments:84 (10 by maintainers)

github_iconTop GitHub Comments

23reactions
tizmagikcommented, Mar 22, 2018

We’ve started hitting this fairly frequently now too

8reactions
neborytecommented, Jul 13, 2019

We are hitting this problem as well. Not using Docker. Unfortunately, this issue makes cypress way too unreliable for automated tests.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Masked browser crashes duplicated as renderer crash? IPC ...
in issue 561873 we're facing a long standing reported crash on a RELEASE_ASSERT for lack of a any last resort font. The renderer...
Read more >
102408 - Renderer crash when leaving an app via link, then ...
the note mean, I run into this bug only once ,is unable to reproduce now, tried clear browser data, relaunch chrome, navigate back...
Read more >
Fixing Cypress errors part 1: chromium out of memory crashes
Error: Out of memory, chromium renderer crashed · Solution 1: Use --ipc=host Docker flag · Solution 2: Use --disable-dev-shm-usage Cypress flag.
Read more >
Logging Information on Browser Crashes
Force stopping the processes trigger's Firefox's crash conditions and emulates a real crash scenario. Firefox should ask you to restore your ...
Read more >
Solved: Browser crashes when opening external tool
It is strange it works on Firefox or other browsers but crashes when loaded on Chrome ... Terminating renderer for bad PasswordManager IPC...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found