Skip to content
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

Cypress 3.8.1 with Google Chrome 79 sometimes failing with "Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 20 seconds." #6430

Closed
sergeyKhristenko opened this issue Feb 12, 2020 · 17 comments

Comments

@sergeyKhristenko
Copy link

sergeyKhristenko commented Feb 12, 2020

Current behavior:

Using Cypress 3.8.1 with Google Chrome 79 tests sometimes failing with the error:

  Running:  e2e/mycooltest.js                                               (15 of 28)
Failed to connect to Chrome, retrying in 1 second (attempt 18/32)
Failed to connect to Chrome, retrying in 1 second (attempt 19/32)
Failed to connect to Chrome, retrying in 1 second (attempt 20/32)
Failed to connect to Chrome, retrying in 1 second (attempt 21/32)
Failed to connect to Chrome, retrying in 1 second (attempt 22/32)
Failed to connect to Chrome, retrying in 1 second (attempt 23/32)
Failed to connect to Chrome, retrying in 1 second (attempt 24/32)
Failed to connect to Chrome, retrying in 1 second (attempt 25/32)
Failed to connect to Chrome, retrying in 1 second (attempt 26/32)
Failed to connect to Chrome, retrying in 1 second (attempt 27/32)
Failed to connect to Chrome, retrying in 1 second (attempt 28/32)
Failed to connect to Chrome, retrying in 1 second (attempt 29/32)
Failed to connect to Chrome, retrying in 1 second (attempt 30/32)
Failed to connect to Chrome, retrying in 1 second (attempt 31/32)
Failed to connect to Chrome, retrying in 1 second (attempt 32/32)
Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 20 seconds.

This usually indicates there was a problem opening the Chrome browser.

The CDP port requested was 42207.

Error details:

Error: connect ECONNREFUSED 127.0.0.1:42207
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14)

It always seems to happen on starting new test, never in the middle of a test.

Desired behavior:

Cypress always can connect to chrome when it's needed.

Test code to reproduce

Can't see any specific patterns. Seems to happens time to time in random places.

Versions

Cypress - 3.8.1
Google Chrome - 79
Cypress docker image - cypress/browsers:node13.3.0-chrome79-ff70
OS - ubuntu xenial

@sergeyKhristenko
Copy link
Author

Would you recommend any workaround for this? Other than switching to Electron or rerunning entire suite.

@Narretz
Copy link
Contributor

Narretz commented Feb 12, 2020

3.8.1 isn't the latest release. Have you tested with 3.8.3?

@jennifer-shehane
Copy link
Member

I see that you are using an older version of Cypress. Please update to the current version of Cypress and comment if this is still happening for you and we will consider reopening the issue. Your issue may have already been fixed.

@chisma
Copy link

chisma commented Feb 17, 2020

I see that this issue was fixed on 3.8.1 (#5912). I am on 3.8.2 and still have exactly the same issue. Though it's sporadic, and came up only after a couple of weeks on 3.8.2.

@jennifer-shehane
Copy link
Member

If you're experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix.

@eric-burel
Copy link
Contributor

Hi,
I have a similar error on Chromium 80 with Cypress 4.1:

The CDP port requested was 37435.

Error details:

Error: connect ECONNREFUSED 127.0.0.1:37435 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14)

There is no step to reproduce except following the getting started tutorial, it fails when running the test.

@Clement-Bresson
Copy link

I experience this too with latest "cypress": "4.4.1".

Sometimes, not everytime and without any code change, I get this error at the middle of the tests. As @sergeyKhristenko said, always when cypress starts a new test in my all tests suite, not in middle of one test.

Very difficult to reproduce as it happens quite randomly.

@mikila85
Copy link

4.11.0 Still happening

@jennifer-shehane
Copy link
Member

If you're experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix.

@liyuindeed
Copy link

Hi there,

I have a similar error:

  • For me, It is always happening start from the 2nd test Cucumber BDD feature file.
  • Chrome: Version 81.0.4044.129 (Official Build) (64-bit)
  • Dependencies:
    "cypress": "^4.10.0",
    "cypress-cucumber-preprocessor": "^2.5.4",
    "cypress-image-snapshot": "^3.1.1",
    "cypress-wait-until": "^1.7.1",
    "multiple-cucumber-html-reporter": "^1.17.0"

`Timed out waiting for the browser to connect. Retrying...
Failed to connect to Chrome, retrying in 1 second (attempt 18/62)
Failed to connect to Chrome, retrying in 1 second (attempt 19/62)
Failed to connect to Chrome, retrying in 1 second (attempt 20/62)
Failed to connect to Chrome, retrying in 1 second (attempt 21/62)
Failed to connect to Chrome, retrying in 1 second (attempt 22/62)
Failed to connect to Chrome, retrying in 1 second (attempt 23/62)
Failed to connect to Chrome, retrying in 1 second (attempt 24/62)
Failed to connect to Chrome, retrying in 1 second (attempt 25/62)
Failed to connect to Chrome, retrying in 1 second (attempt 26/62)
Failed to connect to Chrome, retrying in 1 second (attempt 27/62)
Failed to connect to Chrome, retrying in 1 second (attempt 28/62)
Failed to connect to Chrome, retrying in 1 second (attempt 29/62)
Failed to connect to Chrome, retrying in 1 second (attempt 30/62)
Failed to connect to Chrome, retrying in 1 second (attempt 31/62)
Failed to connect to Chrome, retrying in 1 second (attempt 32/62)
Failed to connect to Chrome, retrying in 1 second (attempt 33/62)
Failed to connect to Chrome, retrying in 1 second (attempt 34/62)
Failed to connect to Chrome, retrying in 1 second (attempt 35/62)
Failed to connect to Chrome, retrying in 1 second (attempt 36/62)
Failed to connect to Chrome, retrying in 1 second (attempt 37/62)
Failed to connect to Chrome, retrying in 1 second (attempt 38/62)
Failed to connect to Chrome, retrying in 1 second (attempt 39/62)
Failed to connect to Chrome, retrying in 1 second (attempt 40/62)
Failed to connect to Chrome, retrying in 1 second (attempt 41/62)
Failed to connect to Chrome, retrying in 1 second (attempt 42/62)
Failed to connect to Chrome, retrying in 1 second (attempt 43/62)
Failed to connect to Chrome, retrying in 1 second (attempt 44/62)
Failed to connect to Chrome, retrying in 1 second (attempt 45/62)
Failed to connect to Chrome, retrying in 1 second (attempt 46/62)
Failed to connect to Chrome, retrying in 1 second (attempt 47/62)
Failed to connect to Chrome, retrying in 1 second (attempt 48/62)
Failed to connect to Chrome, retrying in 1 second (attempt 49/62)
Failed to connect to Chrome, retrying in 1 second (attempt 50/62)
Failed to connect to Chrome, retrying in 1 second (attempt 51/62)
Failed to connect to Chrome, retrying in 1 second (attempt 52/62)
Failed to connect to Chrome, retrying in 1 second (attempt 53/62)
Failed to connect to Chrome, retrying in 1 second (attempt 54/62)
Failed to connect to Chrome, retrying in 1 second (attempt 55/62)
Failed to connect to Chrome, retrying in 1 second (attempt 56/62)
Failed to connect to Chrome, retrying in 1 second (attempt 57/62)
Failed to connect to Chrome, retrying in 1 second (attempt 58/62)
Failed to connect to Chrome, retrying in 1 second (attempt 59/62)
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 49379.

Error details:

Error: connect ECONNREFUSED 127.0.0.1:49379
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1128:14)`

@ssuperczynski
Copy link

It is worth to mention it is always happening after the 18th attempt
Failed to connect to Chrome, retrying in 1 second (attempt 18/62).

@Jason-Pham
Copy link

It is worth to mention it is always happening after the 18th attempt
Failed to connect to Chrome, retrying in 1 second (attempt 18/62).

I can confirm this from my end, always failed on the 18th

@mikila85
Copy link

Tests are slow, so you say run headless chrome it is faster.. but headless chrome fails to connect 80% of the time....

@mikila85
Copy link

THIS FIXES THIS PROBLEM!!! by @simisimon in #6540 (comment)_

@siphiwe
Copy link

siphiwe commented Sep 15, 2020

THIS FIXES THIS PROBLEM!!! by @simisimon in #6540 (comment)_

Thank you. Helped me

@ackuser
Copy link

ackuser commented Mar 3, 2021

Do a $ps aux | grep cypress and then kill all the zombi processes :)

@arkachum23
Copy link

As @ackuser mentioned, just kill one of Chrome processes in Activity Monitor or via script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests