Skip to content

Set a default default_sleep_interval for Rspec::Retry

John McDonnell requested to merge jmd/add-default-sleep-interval-retry into master

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

  1. Manually add some code to a spec to make it intermittently fail expect([true, false].sample).to be_truthy
  2. 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.

Edited by John McDonnell

Merge request reports