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 hanging on circleCI but pass locally #21110

Closed
goldylucks opened this issue Apr 17, 2022 · 11 comments
Closed

Cypress hanging on circleCI but pass locally #21110

goldylucks opened this issue Apr 17, 2022 · 11 comments
Labels
CI General issues involving running in a CI provider

Comments

@goldylucks
Copy link

Current behavior

we have a test the works 100% locally, but on circle CI with docker it sometimes pass, sometimes hang forever.

Attaching here a txt file with the output of running cypress with DEBUG, after 2.5 hours we let the test run on the CI

I'd appreciate any insights to help tackle this, and do let me know if there's anything I can do on our end to make it easier for you to know what's going on.

cypress circle ci hang.txt

Desired behavior

should work on the CI like it works locally.

Test code to reproduce

I don't know how to reproduce this, it happens on one of our test suits but not the same test every time, i.e. it's a describe block with many its, and sometimes the first one hangs, someone the first one pass and the second one hangs.

Cypress Version

9.5.2

Other

No response

@CaiqueCoelho
Copy link

CaiqueCoelho commented Apr 17, 2022

Hey @goldylucks I had the same problem some weeks ago and in my case was two problems:

  1. Locally my tests were running in Chrome, but on the CI they were running in Electron
  2. I don't know why, but on CI same Cypress configuration params were ignored

So I fix my problem by passing the Browser and some Cypress configuration directly in my npm script command like:
"test:chrome": "cypress run --config pageLoadTimeout=60000,retries=3,defaultCommandTimeout=4000 --browser chrome"

@goldylucks
Copy link
Author

the problem is cypress hangs, not only fails. And it's just on one test suite, so it's not a config issue IMO.

Also, we also do npx run cypress --browser chrome

@davidmunechika davidmunechika added CI: circle CI General issues involving running in a CI provider stage: needs investigating Someone from Cypress needs to look at this labels Apr 18, 2022
@cypress-bot cypress-bot bot added stage: backlog and removed stage: needs investigating Someone from Cypress needs to look at this labels Apr 29, 2022
@nezlobnaya
Copy link

I am having a somewhat similar issue. MY CYPRESS tests pass locally but are hanging on circleCI. I am getting this error:
Too long with no output (exceeded 10m0s): context deadline exceeded

@nezlobnaya
Copy link

Tests started to hang after --env USERNAME=$USERNAME, PASSWORD=$PASSWORD flag was added to CMD in Dockerfile

@nezlobnaya
Copy link

So, in my case adding --browser chrome flag was a game changer. Obviously using the default Electron is not the best option to run Cypress in a container on circleCI

@TarekAlQaddy
Copy link

@nezlobnaya That was a game changer for me too. using --browser chrome brought the tests from 20m down to 2m only! Thanks

@ParadoxTwo
Copy link

I updated the config to use chrome but that didn't stop the hangs. Now trying the latest orb with chrome.

@AakrritiJain
Copy link

Using --browser chrome to run the tests, still hanging on circleci but passing on my local. Any solution?

@emilyrohrbough
Copy link
Member

emilyrohrbough commented Apr 5, 2023

@goldylucks In the logs you provided, can you share which debug log you enabled? Also, is this a log set from a job you had to manually end in CI after several minutes/hours of this being non-responsive?

@goldylucks / @AakrritiJain / @ParadoxTwo Can you provide debug logs with DEBUG=cypress-verbose:server:browsers enabled? This might give additional browser log insights to take a peak at what is happening. Based on what you are describing, I suspect you are experiencing a browser hang.

@mjhenkes mjhenkes assigned mjhenkes and unassigned emilyrohrbough Apr 11, 2023
@hyungjunk
Copy link

hyungjunk commented Apr 17, 2023

For me, I added experimentalModifyObstructiveThirdPartyCode: true to config and the hanigng goes away.

@mjhenkes
Copy link
Member

Right now there doesn't seem to be enough information to reproduce the problem on our end. Unless we receive a reliable reproduction, we'll eventually have to close this issue until we can reproduce it. This does not mean that your issue is not happening - it just means that we do not have a path to move forward.

Please provide a reproducible example of the issue you're encountering. Here are some tips for providing a Short, Self Contained, Correct, Example and our own Troubleshooting Cypress guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI General issues involving running in a CI provider
Projects
None yet
Development

No branches or pull requests