Commit 1d5c9729 authored by Thong Kuah's avatar Thong Kuah

Setting the env var in spec_helper is not early enough

parent 3d5df5b0
......@@ -6,6 +6,11 @@ require 'gitlab/testing/request_inspector_middleware'
require 'gitlab/testing/clear_process_memory_cache_middleware'
require 'gitlab/utils'
# Set GITLAB_USE_MODEL_LOAD_BALANCING to a non-nil value
# CI tables consistently use the same connection
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82562
ENV['GITLAB_USE_MODEL_LOAD_BALANCING'] ||= 'true'
Rails.application.configure do
# Make sure the middleware is inserted first in middleware chain
config.middleware.insert_before(ActionDispatch::Static, Gitlab::Testing::RequestBlockerMiddleware)
......
......@@ -264,14 +264,7 @@ RSpec.configure do |config|
stub_feature_flags(force_no_sharing_primary_model: false)
end
# Set GITLAB_USE_MODEL_LOAD_BALANCING to a non-nil value
# so that feature, and request specs work with multiple databases
previous_value = ENV['GITLAB_USE_MODEL_LOAD_BALANCING']
ENV['GITLAB_USE_MODEL_LOAD_BALANCING'] ||= 'true'
example.run
ENV['GITLAB_USE_MODEL_LOAD_BALANCING'] = previous_value
end
config.append_after do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment