cypress: Failing to reliably connect to Chrome on 4.7.0 when using -b chrome --headless
When upgrading to 4.7.0 (from 4.6.0) we are getting error messages when connecting to chrome about 50-75% of the time, this was not a problem before 4.7.0 (we have used Cypress for a couple of years now).
It only happens when we use -b chrome --headless

Versions
4.7.0 Windows 10 Chrome 83
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 35 (1 by maintainers)
I get this issue commonly on macOS Catalina and the latest Cypress versions. Not sure how to replicate, but the fix is to kill the orphaned Chrome process.
I’m getting this error locally as well. I’m running MacOS BigSur 11.5, Chrome Version 92.0.4515.107, Cypress 7.5.0. It only occurs when I’m not running headless. I can run headless just fine.
Edit: restarting my machine seems to have fixed my issue.
@eabusharkh0 something like the following in plugins/index.js: Cypress 4+:
Or before Cypress 4:
Still experiencing this problem on version 7.0.1, MacOS Catalina with Chrome 89. Already restarted computer, run
npx cypress cache clearandnpx cypress installmultiple times. Added the following code toplugins/index.jsbut still not connected:Can anyone help?
Seeing this a lot (on Gitlab CI) after upgrading to 7.1.0 with the workaround outlined above:
@eabusharkh0 Change it to launchOptions.args.push(‘–disable-gpu’);
@eabusharkh0 I believe that should be ‘disable-gpu’ not ‘another-arg’. another-arg was just an example of adding an argument.