Closed simplenotezy closed 1 year ago
I might have a similar issue. For me it hangs in CI but also when i run the test locally with a headless browser. It seems to work fine when i run it with "open".
I've also noticed that it runs fine with when i ran it with ".only", finally i just skipped another pretty insignificant test and it works now. No idea what is going on tbh.
I do use route2 / intercept in the test and i noticed sometimes that it worked when i removed the cy.wait([alias]) stuff.
I don't have the time to try to do a reproduction atm but i just want to ping here if more people have the same issue.
Ps. I've also updated from 5.x to 6.0 to see if that helped but same issue.
Same issue in our case. Updating to 6 triggered most of the time infinite hangs (more than 1 day before we killed it). We are in early adoption of Cypress and we do not have complex tests. No usage of intercept
or route
. On several builds containing two parallel step of Cypress runs, it hanged sometimes in one step, sometimes on the other one. Multiple time we had the same step stuck but it did not block at the same test. So it seems not related to some kind of test content.
Here our output (without errors to be spotted):
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 6.0.0 │
│ Browser: Chrome 83 (headless) │
│ Specs: 3 found (tests/Admin/Product.feature, tests/Admin/Profile.feature, tests/Admin/Sho │
│ oting/Create.feature) │
│ Searched: cypress/integration/**/Admin/**/* │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: tests/Admin/Product.feature (1 of 3)
Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
Reverting to Cypress 5.4 (our previous version) seems to fix the issue.
Can you provide a reproducible example? It's likely very specific to the tests and how they are written. We'll need that in order to investigate. Here are some tips for providing a Short, Self Contained, Correct, Example and our own Troubleshooting Cypress guide. Thanks!
We use https://github.com/TheBrainFamily/cypress-cucumber-preprocessor to write our tests in Gherkin, and we do some cookie preservation using before hooks. This is the only things I really see which could be specific to our tests. However, this was already the case in the 5.X implementation.
Is there any way to have logs to understand where it is really hanging? As explained above, in our current problem, hangs occurs in mostly all tests, but sometimes does not occurs at all and tests are OK. It makes isolating the issue really difficult.
FYI I do cookie preserving to, will see if i can manage to create a reproduction but have a lot to do atm and will live with some skipped tests for now.
if this is only happening in cypress run
mode and not in open
mode, it could be Cypress trying to mistakenly serialize a DOM node or the window object to send to the terminal reporter. We have safeguards around that but there may be another edge case. If we can get a reproducible there should be an obvious fix. Thanks
I've been having similar issues, really weird behaviour for jenkins+docker+cypress combination.
I don't even know much about cypress, however --ipc=host
and --shm-size=512m
(or more) are essential for electron. That's for a start.
Now -- I've been able to fix the issue with abandoning the docker.image().inside{}
pipeline contruction. It's actually is a dirty shell hack based on cat
command. Perhaps cypress does some interactions with it's runtime environment which just don't work here.
So far this has been consistent to me. You could give it a try if you're using the docker.image().inside{}
block for cypress calls.
This refers to scripted pipeline, I believe declarative pipeline docker calls also translate to .inside{}
.
My issue went away when I used electron instead of chrome inside docker container
My issue went away when I used electron instead of chrome inside docker container
We use electron in Docker and it reproducing anyway. The only thing that I can say for now, that it gets reproduced in most of the cases when we run all the tests (it's more than 500) if running 3,14,101 then don't encounter the issue.
My issue went away when I used electron instead of chrome inside docker container
We use electron in Docker and it reproducing anyway. The only thing that I can say for now, that it gets reproduced in most of the cases when we run all the tests (it's more than 500) if running 3,14,101 then don't encounter the issue.
Waw. 500? I'm just running approx under 50 cases. Have you tried to invoke garbage collection in between after each? Also, try to set numTestsKeptInMemory to 0 ..
Can anyone provide a reproducible example? Right now there doesn't seem to be enough information to reproduce the problem on our end. We'll have to close this issue if we can't 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 comment in this issue with a reproducible example.
I can't really provide a reproducible example. We were able to resolve our issues by distributing the tests to more Jenkins nodes. So far we just had one and ran 2-3 cypress instances in parallel. Sometime it worked, sometimes it crashed without a good hint.
I observed the similar issue today, where Cypress hangs forever in headless mode. It took sometime to figure out a test which was causing the issue. When I disabled the test, it worked fine.
Basically the test checks that after logout, I should not go back to home page, by clicking back or forward button. I'm not sure which step was causing issue, but after disabling this test, everything worked fine.
homePage_PO.logout()
cy.log('press back button') cy.go('back') cy.url().should('include', loginPage_PO.loginPageUrl)
cy.log('press forward button') cy.go('forward') cy.url().should('include', loginPage_PO.loginPageUrl)
Can confirm this is happening for us as well. Using Cypress 8.7.0 in Azure Devops. Sometimes it runs under 6 minutes. Sometimes it's stuck at the first test and the pipeline times out. Can't provide any meaningful reproduction steps as the issue seems intermittent.
I ran into this problem after upgrading from 8 to 9.5.4
Confirming we're running into this as well with upgrading from 3 to 9.5.4.
Tests that weren't failing before we deleted a lot of useless ones are now failing consistently, they're handing on trying to load the first test, but the rest of the suite will pass without issue. It makes no sense.
cy:open
runs without issue.
If any of you are still experiencing this issue, can you please run with DEBUG=cypress*
to gather the verbose logs to see if additional information can be uncovered?
@emilyrohrbough Does that help? https://gist.github.com/bbernhard/cc5f2d35394929c3639947aef5088bf2
Just FYI, this is what this issue looks like for me in Buildkite:
[2022-08-15T09:20:36Z] Running: case-management/CaseActivity.e2e.test.ts (3 of 15)
--
| [2022-08-15T09:20:36Z] Estimated: 5 minutes, 11 seconds
| [2022-08-15T09:20:40Z]
| [2022-08-15T09:20:40Z]
| [2022-08-15T09:20:40Z] Case Activity - Smoke Test
| [2022-08-15T09:21:52Z] ✓ Successfully create case comment (71288ms)
| [2022-08-15T09:22:56Z] ✓ Ctrl + enter form submission works (63601ms)
| [2022-08-15T09:23:50Z] ✓ Check stix field validation (53490ms)
| [2022-08-15T09:25:27Z] ✓ Check form field validation (96655ms)
| [2022-08-15T09:25:27Z]
| [2022-08-15T09:25:27Z]
| [2022-08-15T09:25:27Z] 4 passing (5m)
| [2022-08-15T09:25:27Z]
| [2022-08-15T11:46:27Z]
| [2022-08-15T11:46:27Z] (Results)
| [2022-08-15T11:46:27Z]
| [2022-08-15T11:46:27Z] ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
| [2022-08-15T11:46:27Z] │ Tests: 4 │
| [2022-08-15T11:46:27Z] │ Passing: 4 │
| [2022-08-15T11:46:27Z] │ Failing: 0 │
| [2022-08-15T11:46:27Z]
Note a large gap with apparently no activity between the tests reporting as passing 4 padding (5m)
and the results showing (Results)
.
Environment info:
Cypress: 9.5.3
Browser: Electron 94 (headless)
Node Version: v14.17.0 (/usr/bin/node)
Upgraded to Cypress 9.7.0 and same issue.
A hang regarding this may have been handled in Cypress 10.11.0
Having exactly the same issue, at least according to github actions timestamps we have cypress pausing for several minutes between X passing (Ys)
and (Results)
.
Tried upgrading to cypress 11.1.0 and this has not changed anything.
Note that I switched from electron to chrome and now it seems to run much quicker and the delays seem to be gone.
See this behaviour with version 12 now, on the slow connection a test hangs forever on the default blank page. Running in Chrome.
Is it the same as https://github.com/cypress-io/cypress/issues/8206, or are there meaningful differences between the two?
In order to give our engineers the best chance at recreating your problem, please create a reproducible example using a fork of Cypress Test Tiny. This gives us the best chance of seeing exactly what you are seeing and being able to investigate effectively. If we don't receive a way to exhibit this behavior we won't be able to move forward and will have to close this issue until we can reproduce this problem.
Unfortunately we have to close this issue due to inactivity.
We are facing the same issue. The testcase gets stuck in a machine ( we have 14 ) ,Is there a option to see what is the current state of test in cypress cloud ? We dont even get video of the stuck testcase. It happens randomly and random testcases get stuck not the same one so its very difficult to know the reason @nagash77 Any help will be appriciated
We are also facing the same issue. Using the current cypress ver 13.7.3.
Current behavior
When running my tests on my CI (Jenkins) tests takes more than an hour to complete (possibly never completing)
They run fine on my macOS. I have just updated from version 5 to 6 to test if that could solve anything, but the same error happens.
When I go in and inspect the Console Output from the current job (that runs my deployment and cypress tests), it is just stuck here:
The whole output is this:
Screenshots of htop on machine where test is hanging:
Versions
Version 6 (latest)