diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-24 06:07:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-24 06:07:39 +0300 |
commit | 48c3a57e1b5e5a4bffe074c6d5ca9b9ee85aaf2f (patch) | |
tree | fd31682f3946c2944c7cc7ed7a19cb5f7ef6cd77 /spec/workers/concerns/limited_capacity | |
parent | a85d15fdb3869157b467af20805f316d11739f74 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/concerns/limited_capacity')
-rw-r--r-- | spec/workers/concerns/limited_capacity/worker_spec.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/spec/workers/concerns/limited_capacity/worker_spec.rb b/spec/workers/concerns/limited_capacity/worker_spec.rb index 65906eef0fa..8092adec3b9 100644 --- a/spec/workers/concerns/limited_capacity/worker_spec.rb +++ b/spec/workers/concerns/limited_capacity/worker_spec.rb @@ -57,10 +57,26 @@ RSpec.describe LimitedCapacity::Worker, :clean_gitlab_redis_queues, :aggregate_f it 'enqueues jobs' do expect(worker_class) .to receive(:bulk_perform_async) - .with([[:arg], [:arg], [:arg]]) + .with([[:arg], [:arg], [:arg]]).and_call_original + + expect(Sidekiq::Client).to receive(:push_bulk) perform_with_capacity end + + context 'when max_running_jobs is 0' do + let(:max_running_jobs) { 0 } + + it 'does not enqueue jobs' do + expect(worker_class) + .to receive(:bulk_perform_async) + .with([]).and_call_original + + expect(Sidekiq::Client).not_to receive(:push_bulk) + + perform_with_capacity + end + end end describe '#perform' do |