Set a default default_sleep_interval for Rspec::Retry
What does this MR do and why?
Set a default default_sleep_interval for Rspec::Retry
We use Rspec::Retry to rerun fails specs automatically. However in certain circumstances temporarily environmental issues may be the root cause for failures. By retrying without a wait, we may be more likely to reproduce the same issue multiple times, whereas with a sleep, the environment may have an opportunity to recover.
How to set up and validate locally
- Manually add some code to a spec to make it intermittently fail
expect([true, false].sample).to be_truthy
CI=true CI_PROJECT_NAME=abc bundle exec rspec qa/specs/features/path/to/spec.rb
Retry a number of times and you should see the spec fail 50% of the time. Note that the retry doesn't begin instantly, and instead respects the default_sleep_interval
configuration before retrying.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by John McDonnell