-
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
Hangs indefinitely while running tests #1235
Comments
Just to note, i do not see anything SPECIFICALLY wrong with these test cases, but its certainly a few specific cases having this issue. Any ideas what may even cause indefinite hanging? Like hours long hanging on one test which runs fine in the runner? |
I do see behavior like this on jenkins run.
it continues to print out cypress:server:timers repeatedly without terminating. Is there a way to terminate cypress process in such scenarios? Because I see this to happen repeatedly in my test suite. |
This is kind of a huge deal breaker / blocker in terms of us using cypress. I wish there was more visibility on the issue. |
@egucciar We really need a reproducible code example/repo to be able to begin work on this. There are an infinite number of variables that could be involved. |
considering the code / test suite is private intranet code (non public, id be breaking my NDA if i shared it) I can't actually make it public. Any suggestions on how to go about this? Capturing logs or anything ? |
I do see similar behavior of hanging without failing on Jenkins 2.0.105 run headless using the electron browser. I do not have a large test suite either, the tests complete fine and the video gets saved but cypress doesn't quit after that and hangs just like that, on putting Debug to the command I see such messages over and over (just pasting a part of it)
|
@kartikupreti @egucciar dont you wish for a timeout functionality? Something that kills the cypress tests after say 10 mins? |
@mlangley2010 I think The issue you are getting is different (and might just be specific to your application/gateway not responding/forwarding the response to the UI on time.. just increasing the pageLoadTimeout from cypress.json should help in your case) @ksmahesh The kill functionality can be implemented probably just by putting a timeout around that stage/step in jenkins? |
Duplicate of #674 |
@ksmahesh check out this issue. #1333 (comment) You're seeing the timers continue to fire because the Browser is still open. So something is failing with closing the browser. |
@kartikupreti It appears to not be happening anymore today. But no matter what I had the timeout set to Cypress would not advance past that failed step. My timeout was set to 60 seconds, and you can see the test had been running for 245.60, and that was the only step I had tried to run. Regardless, it sounds like the comment posted above in #1333 is a plausible explanation. Thanks! |
@mlangley2010 If you're describing an error happening in a |
this seems to happen consistently whenever we create forEach loops to generate tests. Though tests run fine in the runner, upon running them inside Command Line, after getting through a few tests, it hangs indefinitely, no error message, nothing. |
@ksmahesh how did u run the command line with DEBUG ? we are trying to find out why our suite is hanging |
@egucciar Set the DEBUG environment variable: |
@shcallaway did you ever see your problem get resolved? Was it happening within a loop of some kind? We are seeing the same logs as you observed. Timer sending ID child receiving ID log. Same exact issue is happenign when we refactored some of our repetitive tests to leverage a .forEach. We are trying to recreate the issue using Kitchen Sink suite. |
I have a scenario that appears to be 100% reproducible. Its a very simple test that hangs at the very last step. Running on Windows 10. Using Cypress Binaries downloaded directly today 04-18-2018 - v1.8.2 Chrome Version 65 https://github.com/richdom81/CypressRepro Let me know if more info is needed. |
Yes, @richdom81 example can be reproduced with this code: it('Guest Checkout', function () {
cy.visit('https://www.prepsportswear.com/school/us/texas/el-paso/riverside-high-school-rangers/productlist?schoolid=190145&category=30')
cy.get('#uxProductList > :nth-child(1) > :nth-child(4)').click()
}) The browser actually ends up freezing if you only visit the page and wait like 30 seconds also. |
Hi - Curious if anyone has a chance to take a look at this. We are planning to move our integration test strategy over to Cypress from Selenium, however if we are not able to access the school pages above (which is the bulk of our customer orders) we'll have to reconsider. Any help would be greatly appreciated!. |
@richdom81 I have brought the attention of the team to this bug, but as we are a small team, it may take some time to debug the root of the issue, as we are slated for other work at the moment. We can prioritize bug fixes, do screensharing, and code reviews under our premium support - and could more quickly look into the issue with this kind of workflow. If you’re interested in this kind of premium support, please let us know by emailing support@cypress.io. |
I'm experiencing the same issue running cy test in a Docker container on Jenkins. Are there any workarounds to fix the issue? |
This comment has been minimized.
This comment has been minimized.
For us, it had to do with how Cypress handels eventListeners. We had a is file that was attempting to clear all eventlisenters after cypress.runner.js cleared them. The result was the Chrome Browser hanging from a forever loop due to our file. |
Richard, can you provide a tiny reproduction of what you mean?
…Sent from my iPhone
On May 18, 2018, at 23:15, Richard Dominguez ***@***.***> wrote:
For us, it had to do with how Cypress handels eventListeners. We had a is file that was attempting to clear all eventlisenters after cypress.runner.js cleared them.
The result was the Chrome Browser hanging from a forever loop due to our file.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
To chime in |
Oh my. Could it be the onbeforeunload handler in some apps? I don't work at the company anymore where we had the hanging tests but come to think of it, in a suite of near 100 tests, there was only a dozen that would consistently hang. I implemented the features it was testing and for that feature set, And only that feature set , I setup an onbeforeunload handler. It's the only feature in the app that sets up such a handler and the only tests that were hanging interact with that feature . It would be really interesting if that's been the root cause |
This comment has been minimized.
This comment has been minimized.
In my case I was migrating tests from nightmare where you need to fire the callback when the test is complete. I had left the callback in the function call. Was: Now: Tests no longer hang - this wont be a fix for the majority but thought I would add it for others to check. |
Also, for those using docker adding |
@egucciar It might be, or you might have a modal or dialog open that prevents the browser from closing. I was able to see that cypress (looked like it) was hung after the test was done because our webpage threw a popup ( to save or discard changes) which doesnt let the user just close the tab with unsaved changes, I ran cypress with --headed and I could see the the browser just remained open indefintely after the failing test due to this. So it used to look like its hanging in video recording step but in reality the browser(electron) itself hadn't closed. and I added appropriate beforeEach and afterEach hooks and now it all runs good always. @ksmahesh this might be the case for you too, your debug log is similar to how mine was. |
Yep. As I recall the onbeforeunload created a dialog so the user would not lose their unsaved changes. |
Happened for me as well - after a specific test it would just fail to close, logs indicating it's just sending timers, not sure what that means. Test didn't do anything, just had a simple selector and assertion. After adding Happened both on versions |
Switching to Chrome instead of using Electron as default browser fixed the issue for me as well!!! Yay! I was using
I'm also using cypress version |
For me the problem currently occurs with version 3.0.3 and Electron in a Docker container. Working workaround are:
|
I just found out one more possible error source. We are using the Chrome seems to bypass it with an error message in the console:
Electron just stops at some point and becomes totally unresponsive. Simple workaround ist to check the User agent for Cypress: if (!navigator.userAgent.includes('Cypress')) {
window.addEventListener("beforeunload", this.beforeunloadFunction)
} |
@astehlik that was one of the known causes I believe but was existing even in 2.x. If you scroll up in this thread you will see too. |
Environment: CircleCI-2.1 (docker image: cypress/base:8) We have had a hard time reproducing this issue because it would fail on various tests (thankfully it was the same few). As we continue to debug this (i've already sank 4 days into this, i have updated how we run our cypress tests to kill hanging tests and re-run. I discuss how here: |
We fixed the hanging issues when running in CI with Electron where it would start a spec but never open the browser or move on. @georgesequeira Is there something different in here than what we're aware of? |
I'm going to close this issue as I believe it's been resolved by the primary cause of the specs hanging in |
Thanks @brian-mann. I’ll do the update next week and see if it’s resolved. |
@brian-mann filed: #2392 |
@astehlik solution fixed our problem, too. |
If it's helpful for you to know: My team (who experienced these hangs)
also uses `onbeforeunload` throughout our application.
I'll try the `userAgent` workaround Roberto has suggested.
Thanks!
…On Mon, Sep 17, 2018 at 5:51 AM Roberto Lucha ***@***.***> wrote:
I just found out one more possible error source.
We are using the beforeunload callback in our application.
Chrome seems to bypass it with an error message in the console:
[Intervention] Blocked attempt to show a 'beforeunload' confirmation panel
for a frame that never had a user gesture since its load.
https://www.chromestatus.com/feature/5082396709879808
Electron just stops at some point and becomes totally unresponsive.
Simple workaround ist to check the User agent for Cypress:
if (!navigator.userAgent.includes('Cypress')) {
window.addEventListener("beforeunload", this.beforeunloadFunction)
}
This fixed our problem too
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1235 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ASVy0X-K_Wb9zla2zgjQlOpaY9Vk2HIqks5ub36pgaJpZM4Rv9IC>
.
--
Darin Kelkhoff, CTO
Infoplus Commerce <http://www.infopluscommerce.com>
314.484.2982 <//1-314-484-2982> | 855.981.1854 <//1-855-981-1854>
|
still actual for me. Tried to all the workarounds posted here. Didn't help |
Since this issue is covering quite a broad spectrum of performance issues at this point - we will lock this issue for discussion. Please reopen any issues you are experience (or comment on existing issues - check our performance tag) with reproducible examples. We cannot do anything without the exact code to run to reproduce and any issues opened without reproducible code will be closed. |
Current behavior:
While running my tests, Cypress suddenly stops responding. It will not continue running tests...
Desired behavior:
It shouldnt hang indefinitely with no way of me knowing why
How to reproduce:
not sure, i have a giant test suite with a loop. it was working fine until it wasnt.
Test code:
gigantum test suite
Additional Info (images, stack traces, etc)
The text was updated successfully, but these errors were encountered: