cypress: Retries hangs on failed assertions
Current behavior:
Sometimes Cypress hangs to eternity on failed assertions while Retries functionality is active. I described it once in this ticket: https://github.com/Bkucera/cypress-plugin-retries/issues/64#issuecomment-675498787
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
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 21 (18 by maintainers)
The code for this is done in cypress-io/cypress#8527, but has yet to be released. We’ll update this issue and reference the changelog when it’s released.
I think I found the source of the issue, hoping to get a patch out in the next release.
@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.
https://github.com/cypress-io/cypress-test-tiny/pull/62/commits/ae67c76a371356a0abcf8696810a19b0c19abc0f https://github.com/cypress-io/cypress-test-tiny/pull/62/commits/e52a63d77f62f78404249e7ed64e250f620b082b https://github.com/cypress-io/cypress-test-tiny/pull/62/commits/739d2c8050b00f1623abeb8113de9fefec8736af
Is that enough to investigate? I ask because this issue is still labeled “Needs information”
Yah, it reproduces it when running via
cypress run
, not duringcypress open
.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.
Same happened for us. Usually our test suite finished in about 3 or 4 minutes max (success/failure). Nothing changed, we just enabled retries
runMode: 3
and then our last CI cypress run lasted ran for 01:32:22 according to the Cypress Dashboard, but actually the Github Action was still running after 4h 34m.It hits the first failure and then just hangs forever, it literally does nothing else:
(Attempt 1 of 4) test name omitted here (Attempt 1 of 4) test name omitted here (Attempt 2 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.