question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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 https://github.com/cypress-io/cypress/issues/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,

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:4
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
MadLittleModscommented, Nov 25, 2019
1reaction
alxndrcommented, 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
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unit test passes when in debug but fails when run
When I run the test I don't think the index has been populated in time, no matches are returned and the test fails....
Read more >
Debugging Failing Tests and Test Pipelines - GitLab
Guidelines for investigating end-to-end test pipeline failures. ... The test pipelines run on a scheduled basis, and their results are posted to Slack....
Read more >
Rerun and debug tests | PyCharm Documentation - JetBrains
Run, debug, test, and deploy. Test. Rerun and debug tests ... debugging can help you quickly inspect the failures, preview the problematic ...
Read more >
matlab.unittest.plugins.StopOnFailuresPlugin class - MathWorks
StopOnFailuresPlugin constructs a plugin to debug test failures. ... At the command prompt, create a test suite from ExampleTest and run the tests....
Read more >
Debug unit tests with Test Explorer - Visual Studio (Windows)
In the Visual Studio editor, set a breakpoint in one or more test methods that you want to debug. Note. Because test methods...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found