spec_helper: retry failing CI tests.

This should help avoid a bit of the flakiness we see in builds at the
cost of a slight slowdown on retries.
This commit is contained in:
Mike McQuaid 2020-06-29 09:54:06 +01:00
parent 4398e7bf79
commit 3fc76171ca
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

View File

@ -78,6 +78,17 @@ RSpec.configure do |config|
c.max_formatted_output_length = 200
end
# Use rspec-retry in CI.
if ENV["CI"]
config.verbose_retry = true
config.display_try_failure_messages = true
config.default_retry_count = 2
config.around(:each, :needs_network) do |example|
example.run_with_retry retry: 3, retry_wait: 3
end
end
# Never truncate output objects.
RSpec::Support::ObjectFormatter.default_instance.max_formatted_output_length = nil
@ -124,10 +135,6 @@ RSpec.configure do |config|
skip "Requires network connection." unless ENV["HOMEBREW_TEST_ONLINE"]
end
config.around(:each, :needs_network) do |example|
example.run_with_retry retry: 3, retry_wait: 1
end
config.before(:each, :needs_svn) do
skip "subversion not installed." unless quiet_system "#{HOMEBREW_SHIMS_PATH}/scm/svn", "--version"