diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-30 12:09:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-30 12:09:22 +0300 |
commit | ef144889c1bb80372e25f38fc89c7832ce84417a (patch) | |
tree | 54fa644c7be78fa1a562ca5f97b7f295647e1ce1 /spec/workers | |
parent | 286bddcf3c62ca6fc499e1d5b6e678c0866fecc4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/container_registry/record_data_repair_detail_worker_spec.rb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/spec/workers/container_registry/record_data_repair_detail_worker_spec.rb b/spec/workers/container_registry/record_data_repair_detail_worker_spec.rb index f107144d397..118b897b26f 100644 --- a/spec/workers/container_registry/record_data_repair_detail_worker_spec.rb +++ b/spec/workers/container_registry/record_data_repair_detail_worker_spec.rb @@ -148,14 +148,23 @@ RSpec.describe ContainerRegistry::RecordDataRepairDetailWorker, :aggregate_failu end describe '#max_running_jobs' do + let(:max_concurrency) { 3 } + + before do + stub_application_setting( + container_registry_data_repair_detail_worker_max_concurrency: max_concurrency + ) + end + subject { worker.max_running_jobs } - it { is_expected.to eq(described_class::MAX_CAPACITY) } + it { is_expected.to eq(max_concurrency) } end describe '#remaining_work_count' do + let_it_be(:max_running_jobs) { 5 } let_it_be(:pending_projects) do - create_list(:project, described_class::MAX_CAPACITY + 2) + create_list(:project, max_running_jobs + 2) end subject { worker.remaining_work_count } @@ -163,9 +172,10 @@ RSpec.describe ContainerRegistry::RecordDataRepairDetailWorker, :aggregate_failu context 'when on Gitlab.com', :saas do before do allow(ContainerRegistry::GitlabApiClient).to receive(:supports_gitlab_api?).and_return(true) + allow(worker).to receive(:max_running_jobs).and_return(max_running_jobs) end - it { is_expected.to eq(described_class::MAX_CAPACITY + 1) } + it { is_expected.to eq(worker.max_running_jobs + 1) } context 'when the Gitlab API is not supported' do before do |