Skip to content

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

Closed
@nids2307

Description

@nids2307

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions