Commit 808b2598 authored by Thong Kuah's avatar Thong Kuah

Merge branch 'fix-decomposed-pipeline-phase-4-rollout' into 'master'

Fix decomposed pipeline phase 4 rollout

See merge request gitlab-org/gitlab!80855
parents c5cd56d7 1d53cb06
......@@ -7,13 +7,6 @@ RSpec.describe Gitlab::Database::LoadBalancing::Configuration, :request_store do
let(:db_config) { ActiveRecord::DatabaseConfigurations::HashConfig.new('test', 'ci', configuration_hash) }
let(:model) { double(:model, connection_db_config: db_config) }
before do
# It's confusing to think about these specs with this enabled by default so
# we make it disabled by default and just write the specific spec for when
# it's enabled
stub_feature_flags(force_no_sharing_primary_model: false)
end
describe '.for_model' do
context 'when load balancing is not configured' do
it 'uses the default settings' do
......
......@@ -252,6 +252,20 @@ RSpec.configure do |config|
::Ci::ApplicationRecord.set_open_transactions_baseline
end
config.around do |example|
if example.metadata.fetch(:stub_feature_flags, true)
# It doesn't make sense for this to default to enabled as we only plan to
# use this temporarily to override an environment variable but eventually
# we'll just use the environment variable value when we've completed the
# gradual rollout. This stub must happen in around block as there are other
# around blocks in tests that will run before this and get the wrong
# database connection.
stub_feature_flags(force_no_sharing_primary_model: false)
end
example.run
end
config.append_after do
ApplicationRecord.reset_open_transactions_baseline
::Ci::ApplicationRecord.reset_open_transactions_baseline
......
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