Maintenance: Backport rspec-retry to stabilize Capybara tests.

This commit is contained in:
Martin Gruner 2022-04-12 07:41:23 +02:00
parent 85649f8894
commit e50ba0aca5
No known key found for this signature in database
GPG key ID: 1F24F3A68E149925
4 changed files with 17 additions and 1 deletions

View file

@ -172,6 +172,7 @@ group :development, :test do
# test frameworks
gem 'rails-controller-testing'
gem 'rspec-rails'
gem 'rspec-retry'
gem 'shoulda-matchers'
gem 'test-unit'

View file

@ -458,6 +458,8 @@ GEM
rspec-expectations (~> 3.10)
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.11.0)
rszr (0.5.2)
rubocop (1.26.0)
@ -673,6 +675,7 @@ DEPENDENCIES
rchardet (>= 1.8.0)
redis
rspec-rails
rspec-retry
rszr (= 0.5.2)
rubocop
rubocop-faker

View file

@ -61,7 +61,8 @@ RSpec.configure do |config|
# WebMock makes it impossible to have persistent http connections to Selenium,
# which may cause overhead and Net::OpenTimeout errors.
WebMock.disable! if !use_vcr
example.run
# rspec-retry
example.run_with_retry retry: 3, exceptions_to_retry: [Net::OpenTimeout, Net::ReadTimeout]
WebMock.enable! if !use_vcr
end
end

View file

@ -0,0 +1,11 @@
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
require 'rspec/retry'
RSpec.configure do |config|
# show retry status in spec process
config.verbose_retry = true
# show exception that triggers a retry if verbose_retry is set to true
config.display_try_failure_messages = true
# The list of exceptions to fail on should be configured in the individual :run_with_retry calls.
end