Skip to content
代码片段 群组 项目
提交 ac9bc2ac 编辑于 作者: Stan Hu's avatar Stan Hu
浏览文件

Merge branch '331033-silence-exclusive-lease-warnings' into 'master'

Reduce noise of exclusive lease lock for atomic processing service

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/126914



Merged-by: default avatarStan Hu <stanhu@gmail.com>
Approved-by: default avatarStan Hu <stanhu@gmail.com>
Approved-by: default avatarMarcos Rocha <mrocha@gitlab.com>
Co-authored-by: default avatarMax Fan <mfan@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -144,6 +144,10 @@ def lease_timeout
DEFAULT_LEASE_TIMEOUT
end
def lease_taken_log_level
:info
end
def log_running_reset_skipped_jobs_service(jobs)
Gitlab::AppJsonLogger.info(
class: self.class.name.to_s,
......
......@@ -4,6 +4,7 @@
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 @@ def event_on_pipeline(event)
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
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册