-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recover from renderer / browser crashes #349
Comments
We actually have these crashes halfway in a single spec and we have stalling too. I tried debugging this with strace and it seems to be constantly trying to acquire some locks. Setting the |
How could two instances of the test run occur simultaneously? If you wanted to parallelize you would do it over two different docker containers. |
yes, two docker instances. It might be a false fear of a clash. I'm completely unaware/ignorant of what the two docker instances do share with |
Hi I am running test cases on aws ec2 small instance and I am having this issue |
Did you try the |
But I am not using Docker |
if not sandboxed, you might have multiple chrome instances fighting over resources. What is your setup? any concurrency? are you open to a different setup? |
Any update on this? As Im now getting the error with Chromium usually crashes when running amount of test suites. |
This comment has been minimized.
This comment has been minimized.
We've started hitting this fairly frequently now too |
I'm having this happen randomly on travis-ci with cypress 3.0.2 (I just recently started using cypress so no clue if it happened in a previous version). It might be good to add this flag even with #681 resolved. Edit: I was able to resolve my issue by only calling .visit() once and resetting the state of the application between tests. I know that's not ideal, but it works for now. |
In hindsight my fix with |
I'm also getting this issue now with cypress v3.1.0. Any updates? |
Hi cypress team! We are also getting this error when we use We noticed that it happens more when we use |
Hi, I'm currently trying to use cypress in Gitlab CI. I Figured out most parts, except the browser crashing. my current gitlab CI test job is the following: test_dev:
only:
- dev
stage: test
image: cypress/base:10
script:
- npm i --save-dev cypress
- $(npm bin)/cypress run --reporter junit --reporter-options "mochaFile=results_[hash].xml,toConsole=true"
artifacts:
paths:
- cypress/videos
reports:
junit: results_*.xml
expire_in: 1 week This works great when the browser doesn't crash, including test reporting in gitlab's merge requests. However, it fails 50% of the times. Using the --ipc=host tag is afaik not an option in Gitlab CI. |
Have you tried increasing the shared memory instead, like I discribe in #350 ? |
I am using shared runners on gitlab ci, and shm-size doesn't seem to be an option for shared runners. Thanks anyway |
I think you can configure it using this documentation https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runners-docker-section |
Hi Please provide fix / explanation of this issue. It is always happening on one test case (and only one test case). I do not think it has to do with memory but there is no way to know. I was able to reproduce it locally without docker. I think it has to do with origin (subdomain) changes. Thanks EDIT: Just ran in debug mode there is no way of knowing what is causing this problem unfortunately |
Hi, we're also experiencing this issue in Kubernetes (using Jenkins as our CI engine). Would be happy to provide additional information if helpful. |
I've recently started running into the issue, as our codebase starts to acquire more dependencies. It's intermittent and unpredictable. Sometimes I get a passing test, sometimes it fails the moment it begins. After more experimentation, I've found that using the cypress/browsers:chrome69 image instead of the cypress/base:10 made the issue go away. This issue is likely to be tied to an older version of electron being unable to handle a larger codebase, and I think more effort should go into updating electron. |
Awesome. Do you happen to have a repo with an example test to run to reproduce this, or, is it with any test inside of this image? |
After updating to the newest version of Cypress 9.7.0, we started having the crush while running our tests in a Docker container, any updates about a solution for that issur? Thanks! |
Just tried it with 10.0.0 and it cant even get as far as loading the tests before crashing
|
These are the steps i follow to solve this issue:
|
Thank you for your response ! I will try and see if it works |
Still no luck even with this. Interesting tho is ive put a console log before |
any update on this issue? we are experiencing it on version 11.2.0. Thanks! |
Browser crashed with me on version 11.2.0, any update ? |
Hey @brian-mann. Any update on this issue? We are getting |
Experiencing the same issue with 12.1.0. for almost all the tests |
I am also facing the same issue with Cypress 12.3.0 in a Jenkins setup. |
@laerteneto can you try 9.7.0 |
Issue is now fixed for me on 12.3.0. I was stuck on 9.7.0 trying to upgrade every version and it never worked. This version for some reason works again. I am using this docker image with it:
|
@mattvb91, Hello! Can you please tell me what commands do you use in package.json to run tests? |
@Neoxrus86 I just have package.json:
and then in my github actions I mount the folder in with all of my tests and run the npm command above:
in my case I dont have an entrypoint.sh and run tests on |
@mattvb91, Thanks a lot! I'll explore this topic in more detail. |
I'm having this issue with electron right now Cypress
It fails in simple e2e test:
|
Is there any progress on @brian-mann 's original suggestion? Ideally Chromium Renderer process crashes would be
|
Hi @yaroslav-shpylyk can you please open a new issue with your reproducible example? This issue is quite old so we would need more recent examples to be able to properly diagnose and debug. I am closing this issue as Won't Fix, but if you are still seeing a similar problem please do open a new issue and we will be happy to investigate. |
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:
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
The text was updated successfully, but these errors were encountered: