Skip to content
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

Feature: Run until test fails (debug flakey/intermittent errors) #5665

Closed
MadLittleMods opened this issue Nov 12, 2019 · 8 comments
Closed
Labels
stage: proposal 💡 No work has been done of this issue type: feature New feature that does not currently exist

Comments

@MadLittleMods
Copy link

Add a way to keep re-running the test-suite until you run into a failure. When debugging flakey, intermittent failures, it would be nice to just keep retrying the tests until something fails. I don't want to keep pressing re-run manually.

This could be accomplished with cypress run and some outside scripting on top of it but I want to do this inside the cypress open test runner. Using cypress run is also tough to get useful info out of when a failure happens but this is being tracked by #448

There is a Run all tests button in the UI but it only re-runs the test suite once. I want to keep retrying the test suite until some test fails.


Related issues but mainly around retrying failed tests,

@gabbersepp
Copy link
Contributor

Maybe you can take the great retry plugin and inverse its behaviour? Should not be too much efford i think

@gabbersepp
Copy link
Contributor

Or open an issue in its repository. Maybe the owner introduces a flag to switch between both modes?

@MadLittleMods
Copy link
Author

Thanks @gabbersepp! Created an issue over there, kuceb/cypress-plugin-retries#37

@jennifer-shehane jennifer-shehane added stage: proposal 💡 No work has been done of this issue type: feature New feature that does not currently exist labels Jun 30, 2020
@jennifer-shehane
Copy link
Member

There is an example in our recipes that kind of does something similar to this here: https://github.com/cypress-io/cypress-example-recipes/blob/master/test-repeat.js

@alxndr
Copy link

alxndr commented Sep 27, 2021

I've defined a shell function which re-runs the command given until it fails...

until_fail () {
        eval "$@"
        while [ "$?" -eq "0" ]
        do
                eval "$@"
        done
}

Example usage:

$ until_fail npm run -s cypress:run -- --spec cypress/integration/spec_file.js

@jennifer-shehane
Copy link
Member

Please try our 'experimentalRetries’ feature. We’ll be coming out with more around flake detection soon. I’ll close this since we’ve already prioritized this work.

@ConorFayleTCO
Copy link

hi @jennifer-shehane am I right in thinking this feature is locked behind the Team plan, even for running locally? If so, that would be quite disappointing.

@gabbersepp
Copy link
Contributor

gabbersepp commented Feb 5, 2024

hi @jennifer-shehane am I right in thinking this feature is locked behind the Team plan, even for running locally? If so, that would be quite disappointing.

We are using native retry function since 5.0.0 or so without team plan. This is the original issue where the feature was introduced:
#1313 (comment)

not sure what are the differences to the new experimental retry feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: proposal 💡 No work has been done of this issue type: feature New feature that does not currently exist
Projects
None yet
Development

No branches or pull requests

5 participants