summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-03-09 13:12:28 +0100
committerRémy Coutable <remy@rymai.me>2017-03-13 17:33:17 +0100
commit1761da5152e460549e0e827990ea4f36d097db33 (patch)
tree14292fa5edae0e5f7c7e91b605e1fd4e9d782340
parent5f7592d53805b18fbbc2a117ab8b4d953b13dbb1 (diff)
downloadgitlab-ce-1761da5152e460549e0e827990ea4f36d097db33.tar.gz
Retry only on feature specs that use JS, on CI29242-fix-api-specs-potential-weird-failures-on-retries
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--spec/spec_helper.rb7
2 files changed, 7 insertions, 2 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index deeb01f9a3c..db3d25195dc 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -7,8 +7,6 @@ cache:
variables:
MYSQL_ALLOW_EMPTY_PASSWORD: "1"
- # retry tests only in CI environment
- RSPEC_RETRY_RETRY_COUNT: "3"
RAILS_ENV: "test"
SIMPLECOV: "true"
SETUP_DB: "true"
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 068984aee84..ceb3209331f 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -57,6 +57,13 @@ RSpec.configure do |config|
TestEnv.init
end
+ if ENV['CI']
+ # Retry only on feature specs that use JS
+ config.around :each, :js do |ex|
+ ex.run_with_retry retry: 3
+ end
+ end
+
config.around(:each, :caching) do |example|
caching_store = Rails.cache
Rails.cache = ActiveSupport::Cache::MemoryStore.new if example.metadata[:caching]