-
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
Add additional flags when running Chrome #3633
Comments
We'll take a look at these. You can control which additional command line args get passed to chrome as per documented here: https://docs.cypress.io/api/plugins/browser-launch-api.html#Usage |
Interesting. I didn't know that you can already set them. Will have to use installed Chrome browser instead of Electron to be able to use new flags though. |
Yeah I'm only seeing this issue in Electron. I'd like to get this working in our pipeline reliably because the videos produced are invaluable to troubleshooting issues with our application. |
It looks like Electron found the root cause back in 2016 and has labeled it as "Won't fix" So that isn't fun... |
Chrome flags can be updated here: https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/browsers/chrome.coffee#L21 Adding Electron flags may or may not be necessary/supported, but would be added here: https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/environment.coffee#L26 |
I compared the list of flags in the OP to [
"--disable-background-networking",
"--enable-features=NetworkService,NetworkServiceInProcess",
"--disable-backgrounding-occluded-windows",
"--disable-breakpad",
"--disable-component-extensions-with-background-pages",
"--disable-dev-shm-usage",
"--disable-extensions",
"--disable-features=TranslateUI,BlinkGenPropertyTrees",
"--disable-ipc-flooding-protection",
"--force-color-profile=srgb",
"--password-store=basic",
"--use-mock-keychain"
] These probably don't need to be added:
I'm not sure about I think, based on the switch descriptions, these are all a good idea to add:
I also wonder if any/all of these should also be passed to Electron. |
Opened a PR to add all of the args in the above comment (except It doesn't seem like Electron supports passing any of these: https://electronjs.org/docs/api/chrome-command-line-switches Adding |
The code for this is done in cypress-io/cypress#5310, but has yet to be released. |
Released in |
Current behavior:
Currently, Cypress is regularly failing inside Docker. This is a known problem, even described in documentation.
In documentation the workaround is to add
--ipc=host
and there is a link to this issue: #350Another solution mentioned is increasing
/dev/shm
size for the container.But none of this is a solution one can use on public CI systems where you do not control how Docker container is run.
Desired behavior:
When rendering large pages using Cypress inside Docker-based CI systems, Cypress should not crash.
Solution:
Adopt switches used by Google Chrome official puppeteer project. They have various list of switches to fix these and similar problems. See the list here:
Not all are relevant here, but some are. I think it would be great if most of those would be added to Chrome and Electron runners for Cypress, especially when they run inside CI.
The one which seems it will fix the problem with Chrome failing inside Docker-based CI is
--disable-dev-shm-usage
, so at least that one should be added. This is available since Chrome 65.You could even detect if running inside Docker and set this flag automatically (if you do not want to simply set it always). Or if your run Cypress from command line instead of GUI.
For more information see tips section here.
The text was updated successfully, but these errors were encountered: