Commit 8f40a814 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch '324232-update-build-hooks-worker-to-use-replica' into 'master'

Adds data consistency for BuildHooksWorker [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!57575
parents 727c6c7b 36dba7e8
......@@ -7,6 +7,7 @@ class BuildHooksWorker # rubocop:disable Scalability/IdempotentWorker
queue_namespace :pipeline_hooks
feature_category :continuous_integration
urgency :high
data_consistency :delayed, feature_flag: :load_balancing_for_build_hooks_worker
# rubocop: disable CodeReuse/ActiveRecord
def perform(build_id)
......
---
name: load_balancing_for_build_hooks_worker
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57575
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/326095
milestone: '13.11'
type: development
group: group::memory
default_enabled: false
# frozen_string_literal: true
RSpec.shared_examples 'worker with data consistency' do |worker_class, data_consistency: :always, feature_flag: nil|
describe '.get_data_consistency_feature_flag_enabled?' do
it 'returns true' do
expect(worker_class.get_data_consistency_feature_flag_enabled?).to be(true)
end
if feature_flag
context "when feature flag :#{feature_flag} is disabled" do
before do
stub_feature_flags(feature_flag => false)
end
it 'returns false' do
expect(worker_class.get_data_consistency_feature_flag_enabled?).to be(false)
end
end
end
end
describe '.get_data_consistency' do
it 'returns correct data consistency' do
expect(worker_class.get_data_consistency).to eq(data_consistency)
end
end
end
......@@ -22,4 +22,9 @@ RSpec.describe BuildHooksWorker do
end
end
end
it_behaves_like 'worker with data consistency',
described_class,
feature_flag: :load_balancing_for_build_hooks_worker,
data_consistency: :delayed
end
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