-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 Hangs Running Tests With Electron (Headless or Headed) #5139
Comments
headless electron for us stopped working for also. Noticed that electron is not able to connect to localhost as part of our test setup which is whats causing ours to hang. They are working fine in chrome but will be broken for CI Can also resolve other domains no problem but cannot use our local web server, noticed after updating to latest webpack |
I finally got almost all of our tests that were hanging working again. Adding It's weird, because an individual test run by itself would work, but running the entire My suspicion is some sort of race condition or timing issue in Electron. I did notice that when a test would hang, a process called Also noticed an Node.js error message getting written to
Wonder if that is tied to it. |
@nbcarey Thanks so much for providing a repo. I actually couldn't get the first case in chrome or electron from your repo to pass. Here's a screenshot and description of the failure I'm getting.
The mention of it just beginning to fail on a specific date would never be a failure caused from Cypress. Our releases our packaged complete applications, so nothing will change underneath. I would definitely encourage doing some debugging on your side to determine what changed in your application that could have triggered a change (even minor dep updates that seem innocuous could have created a condition that will fail in Cypress Electron). |
Also just bumped into the same issue. Test suite passes in chrome 76, but hangs on electron 61 on CI, locally head-less and with a GUI. I could narrow it down to this:
context('session', () => {
it('first', () => {
cy.visit('/')
})
it('second', () => {
cy.visit('/')
})
})
Will try to provide a repo with a test case soon. |
I'm also seeing this issue with Electron 61 in any tests where I need to switch users for a multi-user interaction. |
Didn't manage to create a test repo yet, but here's the debug output of the test run of the small test-case from #5139 (comment): It seems to hang on trying to clean up a request from the first test, which has a |
@rudolfs are you still having this issue? |
@johnhiggs yes. I had to pause my investigation because of work priorities. I was trying to create a minimal test case but it's a little tricky because we use ReasonML. |
We were finally able to figure out our issue today related to electron not working. It was related to our webpack upgrade and failing on a form try catch error block not cooperating with electron. IMO an electron bug |
Yeah, so our team's been running into this issue as well. A LOT of the problems I've seen relating to this are just coming from old Electron bugs. Electron 61 was released TWO entire years ago on September 5, 2017. So yeah, this is going to be an issue until we can get a newer version of Electron running with Cypress. In a way this IS a Cypress issue, because we need to be able to run on a more recent version of electron. The Cypress team is currently working on an upgrade, so it looks like we probably just have to wait until then. |
Hey @julian-sf, Electron 5.0.10 upgrade (Chrome 73 - PR: #4720) is releasing with 3.5.0, which should come out later this week. So hopefully you won't need to wait much longer. We're also working on upgrading to Electron 6 and keeping it up to date so this big gap doesn't happen again. |
@flotwig Awesome! I know you guys have been working hard on it. I appreciate the update and I'm very much looking forward to the new version! |
I assume this got delayed for some reason? |
@fr0 Indeed, we have had some hiccups. But... soon. We aren't adding any new features for 3.5.0, just making sure that what we're releasing is quality. |
This issue was resolved for me in |
Headless electron has started hanging only on our CI build with both I do have multiple In addition, there is also #5558 and #5603 that seem very similar. Maybe they are more applicable to the |
Note to others. We had a similar issue but turns out it was caused by something we had not considered. Confirm dialogs were blocking were the cy.visit() action in subsequent tests. Its not a problem with chrome because of this The following comment fixed our issue while we look to better handle these cases. |
It hangs in our CI environment as well (headless Electron on Windows) since upgrading from 3.4.1 to Edit: trying to see if it works in 3.7.0 right now... Edit 2: still hangs in v 3.7.0. |
I have the same issue, It hangs in my machine (headless Electron on Windows, cypress 3.7), I have 18 files to test and it hangs always at 16 of 18. Now I am trying with --browser chrome |
My workaround is indeed to use the |
does the last test that runs before it hangs have a confirm dialog as was the case for us? |
Not sure. We tried to reorder our tests to identify the problem… but the stuck is always after the same number of tests...
… On 12 Dec 2019, at 04:02, DaveLHX ***@***.***> wrote:
ialog as was the ca
|
No, I don't see any dialog, if I check the records in GitHub I see all passed tests until 16 of 18 and the others are orange, I also try to wait more than 1 hour but nothing happened. |
- possibly related to this issue, and removes duplication cypress-io/cypress#5139
@simplenotezy Your issue is likely something not related to this issue. Please open a new issue with a fully reproducible example. The tests should not hang ever. |
Since this issue hasn't had activity in a while - and we've updated Electron version quite a lot since this was opened, we'll close the issue until we can confirm this is still happening. Please comment if there is new information to provide concerning the original issue and we'd be happy to reopen. |
Current behavior:
Our CI/CI pipeline runs our Cypress tests on a schedule. This has been working as expected. However, yesterday (12 September 2019), the behavior changed. Instead of running to completion (with or without errors), the test suite now hangs on one particular test case. The CI/CD pipeline eventually times out after 60 minutes.
Running the tests manually on my machine with Chrome via
npx cypress run --browser chrome
ornpx cypress open --browser chrome
works just fine.Running the tests manually with Electron, headless or headless, does not. It exhibits the same hang that our CI/CD pipeline exhibits.
Digging into it I see that it is hanging on the
afterEach()
action, trying to revisit the same page, viacy.visit()
on which the test started. Playing around with things, It seems to fail the same way, any timecy.visit()
is called twice in the context of the same test ofdescribe()
block.Even odder, turning on debug logging via
completed successfully.
Desired behavior:
Tests should run to completion and not hang.
Steps to reproduce: (app code and test code)
npm run succeeds-with-chrome
gives you the happy path.npm run hangs-with-electron
gives you the unhappy path.Versions
MacOS Mojave, v10.14.6
Chrome, v77.0.3865.75
Node.js, v10.16.3
Npm, v6.11.3
Cypress, v3.4.1 (and Electron 61?)
The text was updated successfully, but these errors were encountered: