summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanad Liaquat <sliaquat@gitlab.com>2019-04-03 17:19:17 +0500
committerSanad Liaquat <sliaquat@gitlab.com>2019-04-03 17:19:17 +0500
commita608ac28f94a897ae8f64f0aed74b1c8622284d9 (patch)
tree0512a8171f8bee27dd19df019c53be6a1b137750
parentccdf7a93905bb7fd5eb4be5772160a9fad8e19a4 (diff)
downloadgitlab-ce-qa-lower-retry-times.tar.gz
Reduce no of rspec retriesqa-lower-retry-times
In e2e QA tests, reduce retry to 1 and to zero in unit tests
-rw-r--r--Gemfile1
-rw-r--r--Gemfile.lock3
-rw-r--r--doc/development/testing_guide/flaky_tests.md5
-rw-r--r--qa/spec/spec_helper.rb2
-rw-r--r--spec/spec_helper.rb6
5 files changed, 2 insertions, 15 deletions
diff --git a/Gemfile b/Gemfile
index c0815c4a2a6..3a0098b405c 100644
--- a/Gemfile
+++ b/Gemfile
@@ -334,7 +334,6 @@ group :development, :test do
gem 'database_cleaner', '~> 1.7.0'
gem 'factory_bot_rails', '~> 4.8.2'
gem 'rspec-rails', '~> 3.7.0'
- gem 'rspec-retry', '~> 0.4.5'
gem 'rspec_profiling', '~> 0.0.5'
gem 'rspec-set', '~> 0.1.3'
gem 'rspec-parameterized', require: false
diff --git a/Gemfile.lock b/Gemfile.lock
index 4ebcc6c81b2..d2a0aa3bf45 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -751,8 +751,6 @@ GEM
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-support (~> 3.7.0)
- rspec-retry (0.4.5)
- rspec-core
rspec-set (0.1.3)
rspec-support (3.7.1)
rspec_junit_formatter (0.4.1)
@@ -1125,7 +1123,6 @@ DEPENDENCIES
rqrcode-rails3 (~> 0.1.7)
rspec-parameterized
rspec-rails (~> 3.7.0)
- rspec-retry (~> 0.4.5)
rspec-set (~> 0.1.3)
rspec_junit_formatter
rspec_profiling (~> 0.0.5)
diff --git a/doc/development/testing_guide/flaky_tests.md b/doc/development/testing_guide/flaky_tests.md
index 3d568c37fba..783cb26291a 100644
--- a/doc/development/testing_guide/flaky_tests.md
+++ b/doc/development/testing_guide/flaky_tests.md
@@ -38,10 +38,7 @@ Quarantined tests are run on the CI in dedicated jobs that are allowed to fail:
- `rspec-pg-quarantine` and `rspec-mysql-quarantine` (CE & EE)
- `rspec-pg-quarantine-ee` and `rspec-mysql-quarantine-ee` (EE only)
-## Automatic retries and flaky tests detection
-
-On our CI, we use [rspec-retry] to automatically retry a failing example a few
-times (see [`spec/spec_helper.rb`] for the precise retries count).
+## Flaky tests detection
We also use a home-made `RspecFlaky::Listener` listener which records flaky
examples in a JSON report file on `master` (`retrieve-tests-metadata` and `update-tests-metadata` jobs), and warns when a new flaky example
diff --git a/qa/spec/spec_helper.rb b/qa/spec/spec_helper.rb
index be13c3fb683..a235fddabca 100644
--- a/qa/spec/spec_helper.rb
+++ b/qa/spec/spec_helper.rb
@@ -34,7 +34,7 @@ RSpec.configure do |config|
config.display_try_failure_messages = true
config.around do |example|
- retry_times = example.metadata.keys.include?(:quarantine) ? 1 : 3
+ retry_times = example.metadata.keys.include?(:quarantine) ? 1 : 2
example.run_with_retry retry: retry_times
end
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 60db3e1bc46..9392dda4f4c 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -7,7 +7,6 @@ ENV["IN_MEMORY_APPLICATION_SETTINGS"] = 'true'
require File.expand_path('../config/environment', __dir__)
require 'rspec/rails'
require 'shoulda/matchers'
-require 'rspec/retry'
require 'rspec-parameterized'
rspec_profiling_is_configured =
@@ -49,9 +48,6 @@ RSpec.configure do |config|
config.use_instantiated_fixtures = false
config.fixture_path = Rails.root
- config.verbose_retry = true
- config.display_try_failure_messages = true
-
config.infer_spec_type_from_file_location!
config.define_derived_metadata(file_path: %r{/spec/}) do |metadata|
@@ -100,8 +96,6 @@ RSpec.configure do |config|
config.include PolicyHelpers, type: :policy
if ENV['CI']
- # This includes the first try, i.e. tests will be run 4 times before failing.
- config.default_retry_count = 4
config.reporter.register_listener(
RspecFlaky::Listener.new,
:example_passed,