diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-20 03:09:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-20 03:09:58 +0300 |
commit | 3c25c55bf591097e96170c2d2da1b40d295cc981 (patch) | |
tree | 5418c6aa14eb79619079d1aa7918ae27d6600d46 /spec/services | |
parent | c991a74ffd36af636f3083fed93c0f6e81746f02 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/ci/pipeline_processing/atomic_processing_service_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/services/ci/pipeline_processing/atomic_processing_service_spec.rb b/spec/services/ci/pipeline_processing/atomic_processing_service_spec.rb index 15f2cc0990c..93dc9481bf0 100644 --- a/spec/services/ci/pipeline_processing/atomic_processing_service_spec.rb +++ b/spec/services/ci/pipeline_processing/atomic_processing_service_spec.rb @@ -4,6 +4,7 @@ require 'spec_helper' RSpec.describe Ci::PipelineProcessing::AtomicProcessingService, feature_category: :continuous_integration do include RepoHelpers + include ExclusiveLeaseHelpers describe 'Pipeline Processing Service Tests With Yaml' do let_it_be(:project) { create(:project, :repository) } @@ -1233,6 +1234,19 @@ RSpec.describe Ci::PipelineProcessing::AtomicProcessingService, feature_category end end + context 'when the exclusive lease is taken' do + let(:lease_key) { "ci/pipeline_processing/atomic_processing_service::pipeline_id:#{pipeline.id}" } + + it 'skips pipeline processing' do + create_build('linux', stage_idx: 0) + + stub_exclusive_lease_taken(lease_key) + + expect(Gitlab::AppJsonLogger).to receive(:info).with(a_hash_including(message: /^Cannot obtain an exclusive lease/)) + expect(process_pipeline).to be_falsy + end + end + private def all_builds |