diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-28 15:17:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-28 15:17:26 +0300 |
commit | d6ce16a4070112512d792f7ab66fdca4764cbf2c (patch) | |
tree | a85a3c45b5fb1bfd66badf100198cbc0036227e9 /spec/workers/ci | |
parent | fa4a0663e8c12b7b80e9e7edec99e6ca5a04a253 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/ci')
-rw-r--r-- | spec/workers/ci/delete_objects_worker_spec.rb | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/spec/workers/ci/delete_objects_worker_spec.rb b/spec/workers/ci/delete_objects_worker_spec.rb index 52d90d7667a..3d985dffdc5 100644 --- a/spec/workers/ci/delete_objects_worker_spec.rb +++ b/spec/workers/ci/delete_objects_worker_spec.rb @@ -6,15 +6,16 @@ RSpec.describe Ci::DeleteObjectsWorker do let(:worker) { described_class.new } it { expect(described_class.idempotent?).to be_truthy } + it { is_expected.to respond_to(:max_running_jobs) } + it { is_expected.to respond_to(:remaining_work_count) } + it { is_expected.to respond_to(:perform_work) } describe '#perform' do it 'executes a service' do - allow(worker).to receive(:max_running_jobs).and_return(25) - expect_next_instance_of(Ci::DeleteObjectsService) do |instance| expect(instance).to receive(:execute) expect(instance).to receive(:remaining_batches_count) - .with(max_batch_count: 25) + .with(max_batch_count: 20) .once .and_call_original end @@ -22,30 +23,4 @@ RSpec.describe Ci::DeleteObjectsWorker do worker.perform end end - - describe '#max_running_jobs' do - using RSpec::Parameterized::TableSyntax - - before do - stub_feature_flags( - ci_delete_objects_medium_concurrency: medium, - ci_delete_objects_high_concurrency: high - ) - end - - subject(:max_running_jobs) { worker.max_running_jobs } - - where(:medium, :high, :expected) do - false | false | 2 - true | false | 20 - true | true | 20 - false | true | 50 - end - - with_them do - it 'sets up concurrency depending on the feature flag' do - expect(max_running_jobs).to eq(expected) - end - end - end end |