-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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 during execution of test suite #6695
Comments
When running DEBUG logs, the memory table by default prints every 10 seconds, so this just means that Cypress has hung for some reason. The CPU however does not look to be maxed out, so this is likely not be related to the machine's resources.
If that is the case, there's likely something in the test code that is triggering Cypress to hang for some reason. We'll would need a way to reproduce this locally in order to look into it further. |
Yes is also failing on Chrome. Interestingly on Chrome I can also see request call to weird domains that are not starting from our App. Is that normal or can be a hint? The same test was passing on Chrome with Cypress 3.8.2 I've upgraded Cypress to 4.1.0. but the error persist. Unfortunately I cannot share the test I cannot reproduce it with another test suite Also, locally works fine (Mac) either via visual mode or from terminal.
|
The Chrome requests to weird domains is normal behavior, see here: #3151 |
With v3.8.2 it always passes on Electron, hangs often of on Chrome Compared two stacktraces, same test and configuration: pass on Electron, hangs 50% Chrome.
From this point, Cypress will be hanging until terminated from the CI timeout |
I'm also seeing cypress hanging, how does one obtain the Debug logs? Is it possible to print them to a file, since I cannot log in to my CI instance? |
I can see something like this:
and then Cypress just does nothing and hangs until the CI kills it Maybe this is more helpful:
Also this when trying to run with
|
In my case the real error is above that. That seems to be a internal call that Chrome makes on its own
…On 18 Mar 2020, 12:11 +0000, Marcin Wolniewicz ***@***.***>, wrote:
I can see something like this:
cypress:server:server Got CONNECT request from safebrowsing.googleapis.com:443 +4m
cypress:https-proxy Writing browserSocket connection headers { url: 'safebrowsing.googleapis.com:443', headLength: 0, headers: { host: 'safebrowsing.googleapis.com:443', 'proxy-connection': 'keep-alive', 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/79.0.3945.79 Chrome/79.0.3945.79 Safari/537.36' } } +4m
cypress:https-proxy Got first head bytes { url: 'safebrowsing.googleapis.com:443', head: '\u0016\u0003\u0001\u0002\u0000\u0001\u0000\u0001�\u0003\u00039�B.��\u000b�@***@***.***;� \u000b����6\u0017\u0004ZN�ߪ���w�6�Wq' } +1ms
cypress:network:cors Parsed URL { port: '443', tld: 'googleapis.com', domain: 'safebrowsing' } +4m
cypress:server:server HTTPS request does not match URL: https://safebrowsing.googleapis.com:443 with props: { port: '443', tld: 'com', domain: 'soundtrap' } +1ms
cypress:https-proxy Making connection to safebrowsing.googleapis.com:443 +0ms
cypress:https-proxy getting proxy URL { port: 443, serverPort: 35729, sniPort: 44301, url: 'https://safebrowsing.googleapis.com:443' } +0ms
cypress:network:connect successfully connected { opts: { port: '443', host: 'safebrowsing.googleapis.com', getDelayMsForRetry: [Function: getDelayForRetry] }, iteration: 0 } +4m
cypress:https-proxy received upstreamSocket callback for request { port: '443', hostname: 'safebrowsing.googleapis.com', err: undefined } +28ms
and then Cypress just does nothing and hangs until the CI kills it
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Not exactly related but a lot of people are having the same issue. |
Yes our tests on Cypress also hang on Github Actions |
we faced the same nasty bug and we managed to solve it by adding |
@0xIslamTaha Do you have an idea of how we can configure this option on github actions? :) |
@sebfie, could u share your github action file? If u are using docker-compose or executing |
Here is my github action file :
|
add |
Trying this ! Thx |
@0xIslamTaha It works, a so big thank you ! |
Adding I don't have a reproducible codebase to offer, but here's a description and specs in case they are helpful: I have two spec files. One always works. The other works when tests are ran individually (with Node v12.14.1 |
I confirm I encountered the same issue and shm_size did the trick. |
Increasing the smh_size also worked for our team. |
Please I have this problem of running it locally ... it hangs from time to time on headless mode with chrome ... any ideas ? |
Also having this bug when running locally. Started recently when writing a new spec. It ran for 12s before getting stuck and is still stuck. No timeout or actions happen when running it on Runner. And when trying to run it using CL, title is stuck but nothing else happens. |
not cypress, its chrome |
Setting In my pipeline, Cypress hangs for ~2 minutes while executing the last test (I'm not sure whether being the last is meaningful): Nothing special happens in the test. I have downloaded a video of the problem and Cypress literally hangs for 2 minutes, and then it executes the test (which actually takes ~1 second). |
Is it possible to set the shm_size when running cypress using the cli |
@premkumar-gg |
i fixed the issue by turning off video recording. |
I, too, have reason to believe that this hanging issue is being caused by video records. I was able to actually get the event to occur on my local machine. What happened, I found, is that the stall happens after the "afterEach" event, but before the "after" event. A screen shot was taken of the failure, which looked like this: Here was the logged output:
I tried to view the video, but found that it was corrupt. This leads me to believe the failure happened in the middle of video encoding. Update: After running many many times with video saving turned off, I've run into no more failures like this. I'm pretty sure video processing is the problem here. I'm also inclined to believe it's due to the length of the videos being processed. Our tests run much longer than I think the normal cypress tests run. |
…file-package * main: fix(api): Update XROAD_TJODSKRA_MEMBER_CODE value on staging and prod (#4314) fix(ci): Always run pullrequest (#4330) Disabling Cypress video recording as it seems to make github actions hang. cypress-io/cypress#6695 (comment) (#4326) fix(auth-public-api): Add - to validation. Filter delegations with no scopes (#4306)
EDIT: Got solved by closing and restarting Docker. Not a systematic thing - not reproducible (any more). Experiencing this on Docker Compose, locally.
Either Electron or Chrome browsers - do difference. Symptoms: Exactly as described by the original author. Tests don't seem to start. No errors about it. Since this is an open source project, I can provide the steps to reproduce. Just ask. Work-arounds? Have tried the Service in
|
In my case the hanging was caused by the tests being left as "pending". Interrupting them instead fixed it using this great hack on SO. |
In my case, cypress hangs while inputting special characters- cy.get().clear().type(, { parseSpecialCharSequences: false }) Please note- We have only one 'it' block and approx. 100 lines of code. |
Reposting our solution for visibility: #8206 (comment) |
Reposting our solution for visibility: #8206 (comment) |
Same issue has described by OP. I'm running a 75 specs test suite on 20 parallel machines.
While i'm writing this, 5 runs out the 7 last runs are hanging in Cypress dashboard. This is costing quite a lot of CI money, even with a timeout set in Github Actions.
This is random, I wish I could give you more info to address this issue. Is there any other way we could help? |
It turns out all our tests were hanging on our login page. After removing recaptcha entirely from the page I didn't get any more freezes (at least not yet, but i just ran 45 runs without any issue). This is not ideal since we would like to have our test environments as close to production as possible, with recaptcha using a dev/test key, but for now I guess we will just remove recaptcha from our test environments. I'm also having similar issues with sentry.io requests stuck trying to resolve even if I blocked it in let timer = setTimeout(function () {
timer = null
throw new Error(message)
}, milliseconds)
...
cy.some_action().then(() => {
clearTimeout(timer)
} This workaround does not work with recaptcha that's why we had to remove recaptcha. Hope this helps anyone with the same issue. |
Since this issue hasn't had activity in a while, we'll close the issue until we can confirm this is still happening and the reasons why this has been happening. There's a LOT of things that could cause hanging and we can focus on issues that give clear reproducible examples of hanging. It's clear from this thread that there are various contributing factors that may or may not have been solved over the years. If you experience hanging within Cypress, please open a new issue with details for us to reproduce the issue and include DEBUG logs. |
Current behavior:
During a test run Cypress hangs and never exit, it doesn't print anything in the stdout while it's blocked.
From the DEBUG log can be seen that it goes in a kind of loop and prints
cypress:server:util:process_profiler current & mean memory and CPU usage by process group
every 10 seconds until is terminated by the CI timeoutDesired behavior:
Cypress doesn't hang and instead fails if something goes wrong.
Test code to reproduce
It's not happening 100% of the times so I don't know what's the root cause, however I've attached a debug log
Versions
Cypress 4.0.2 - Chrome 78/Firefox 70.0.1 - Unix
executionLogRedacted.txt
The text was updated successfully, but these errors were encountered: