Cypress: Cypress 5.2.0 : Unable to make a connection to chrome browser

Created on 25 Sep 2020  路  5Comments  路  Source: cypress-io/cypress

Current behavior

cypress run fails in jenkins pipeline with the following error on Chrome:

Failed to connect to Chrome, retrying in 1 second (attempt 60/62)
Failed to connect to Chrome, retrying in 1 second (attempt 61/62)
Failed to connect to Chrome, retrying in 1 second (attempt 62/62)
Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 50 seconds.

This usually indicates there was a problem opening the Chrome browser.
The CDP port requested was 41142.
Error details:
error Command failed with exit code 1.

Note that this doesn't appear to be 100% consistent. I saw it in the past and now have been seeing it again for the last 4 days.

We had previously observed this before, and upgraded cypress version to 5.2.0. followed the steps given on issue #7450 but no luck. Seems like that issue is still open and I assume the fix is still outstanding.

Desired behavior

The tests should kick off successfully without the chrome browser error

Test code to reproduce

Tried the following based on the inputs from one of the users
@nids2307 try below code in Plugins/index.js its working

 module.exports = (on, config) => {
  on('before:browser:launch', (browser, launchOptions) => {
    if (browser.name === 'chrome' && browser.isHeadless) {
      launchOptions.args.push('--disable-gpu');
      return launchOptions
    }
  });
}

Versions

Cypress: 5.0.0 as well as 5.2.0
Browser: Chrome 83
OS: Windows 10

CDP connection bug

Most helpful comment

I still have this issue in my CircleCI pipeline using 5.2.0. '--disable-gpu' makes no difference.

All 5 comments

Not only in Jenkins. I experience this issue frequently on my laptop

How to deal with that if this is so that way

I still have this issue in my CircleCI pipeline using 5.2.0. '--disable-gpu' makes no difference.

I have exactly the same issue, no known resolution yet.

'--disable-gpu' not help. The error still occurs. Checked in travis-ci. Cypress version 5.3.0, 6.0.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jennifer-shehane picture jennifer-shehane  路  3Comments

tahayk picture tahayk  路  3Comments

rbung picture rbung  路  3Comments

zbigniewkalinowski picture zbigniewkalinowski  路  3Comments

jennifer-shehane picture jennifer-shehane  路  3Comments