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
Retries hangs on failed assertions #8363
Comments
Can you provide a reproducible example? We have quite a few tests we run through, so there’s likely something specific about the way the tests are written or run that will trigger this. This will be hard to track down without that, especially if it only fails sometimes. Thanks! |
Same happened for us. Usually our test suite finished in about 3 or 4 minutes max (success/failure). Nothing changed, we just enabled retries It hits the first failure and then just hangs forever, it literally does nothing else: (Attempt 1 of 4) test name omitted here ^ this is the very last line, there is nothing else. edit: The duplicate "Attempt 1 of 4" is also for the same test, which is weird. this happened on all of our CI runners for parallel tests (each one just hit the first error and then the same thing like above happens). edit: Just removed the retries from our cypress config, and the test execution finished again in 4 minutes. |
Same is happening for us, both with the plugin and with 5.0.0. I did an investigation to track down what was hanging, you can see the issue on cypress plugin retries for that, assuming it’s the same problem, but I wasn’t able to work out the exact problem only what was happening. Some of the failed tests hang, whilst others are able to retry 3 times and then fail so I think it is something specific to certain tests. I’ve already spent way too long this week debugging cypress but if I find a reproduction case I will post it. |
I'm unable to recreate this with a We will really need a reproducible example to be able to track this down - there could be a lot of things contributing, such as other defined hooks or things in the project support/plugins. My test code
<html>
<body>
<div>bar</div>
</body>
</html>
it('test', () => {
cy.visit('index.html')
cy.get('div').should('contain', 'foo')
})
{
"retries": {
"runMode": 3,
"openMode": 3
}
} Runs 4 times and correctly ends the test. |
|
Does anyone have a |
@jennifer-shehane no hooks are needed. |
Yah, it reproduces it when running via |
Is that enough to investigate? I ask because this issue is still labeled "Needs information" |
It is, but it's going to take a lot longer to determine the cause with such a large example. |
I meet the similar problem. after upgrade to 5.0.0, deprecate cypress-plugin-retries and use built-in retry function, my test cases fail all the time then hang for serveral hours when run github action. print like below but my code runs well on local machine. the only change is upgrade I run with "cypress run" on local machine again. And It hangs. Maybe it is not about github action. |
@lukeapage I narrowed down the reproducible example to this single spec file. I think the issue is with your overwriting https://github.com/cypress-io/cypress-test-tiny/pull/62/files#diff-05da80f0f815af9c2b8279ce29b86790 Run via |
There’s only a single spec file and spec in that Pr isn’t there? How did you narrow it down to overwriting get ? I can try refactoring that. Unfortunately we got so many issues with overwrite that we don’t use it. |
Sorry I see what you did now. I will take a look later. |
@jennifer-shehane I pushed some commits that simplify it further. I've removed the overwrite of get and also I replaced the "waitForTimers" with a simpler pause - I added the commits in stages because a 1s pause is more likely that it might suddenly stop reproducing.. but for me I still reproduce with the simplified example. cypress-io/cypress-test-tiny@ae67c76 |
@lukeapage K, thanks, thats helpful. |
I think I found the source of the issue, hoping to get a patch out in the next release. |
what reproduces the bug is having a test that fails and retries with an existent DOM node as the subject of an assertion e.g.: cy.get('.element-exists').should('not.exist') our logic only pretty formatted err.actual on test failure, not retry, so the browser hangs trying to serialize an entire DOM node. |
The code for this is done in cypress-io/cypress#8527, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior:
Sometimes Cypress hangs to eternity on failed assertions while Retries functionality is active.
I described it once in this ticket:
kuceb/cypress-plugin-retries#64 (comment)
Now I'm experiencing similar issue in 5.0.0 version.
It's probably a problem with
.should('contain', xxx)
assertion.Test code to reproduce
Versions
5.0.0
The text was updated successfully, but these errors were encountered: