NoRedInk/rspec-retry

Retry until fail

pclalv opened this issue · 2 comments

i sometimes have to debug finicky tests that can pass or fail depending on timeouts or race conditions. while reasoning about these underlying issues is certainly what will ultimately lead to better, consistent specs, i often find myself wishing i could programmatically run them as many times as i wish, until either the specified number of runs has been reached or the test fails. rspec-retry runs until a failing spec passes. i think it makes sense for rspec-retry to also be able to run a spec until it fails.

for a proof of concept, please see my branch. all a user has to do is tag the spec with :retry_until_fail => true and some number of retries, e.g. :retry => 10. i haven't yet written any specs, but i would be happy to do so if they would be of interest.

@michaelglass Setting the retry count to Infinity does not seem to do the same thing that OP was posting about. He seems to specifically be trying to repeat tests until they fail, rather than the default which is repeating them until they succeed.

redacted my comment and you are correct! my bad!