diff options
-rw-r--r-- | lib/gitlab/ci/trace.rb | 2 | ||||
-rw-r--r-- | spec/workers/ci/rescue_stale_live_trace_worker_spec.rb | 2 | ||||
-rw-r--r-- | spec/workers/stuck_ci_jobs_worker_spec.rb | 4 |
3 files changed, 5 insertions, 3 deletions
diff --git a/lib/gitlab/ci/trace.rb b/lib/gitlab/ci/trace.rb index 30f6c624be4..5feef77e27e 100644 --- a/lib/gitlab/ci/trace.rb +++ b/lib/gitlab/ci/trace.rb @@ -215,7 +215,7 @@ module Gitlab # For ExclusiveLeaseGuard concerns def lease_key - @lease_key ||= self.class.name.underscore + ":archive:#{job.id}" + @lease_key ||= "trace:archive:#{job.id}" end # For ExclusiveLeaseGuard concern diff --git a/spec/workers/ci/rescue_stale_live_trace_worker_spec.rb b/spec/workers/ci/rescue_stale_live_trace_worker_spec.rb index 43a6362a131..1a694290562 100644 --- a/spec/workers/ci/rescue_stale_live_trace_worker_spec.rb +++ b/spec/workers/ci/rescue_stale_live_trace_worker_spec.rb @@ -35,7 +35,7 @@ describe Ci::RescueStaleLiveTraceWorker do context 'when build has both archived trace and live trace' do let!(:build2) { create(:ci_build, :success, :trace_live, finished_at: 2.days.ago) } - + it 'archives only available targets' do subject diff --git a/spec/workers/stuck_ci_jobs_worker_spec.rb b/spec/workers/stuck_ci_jobs_worker_spec.rb index bdc64c6785b..c3294fce5ea 100644 --- a/spec/workers/stuck_ci_jobs_worker_spec.rb +++ b/spec/workers/stuck_ci_jobs_worker_spec.rb @@ -132,8 +132,10 @@ describe StuckCiJobsWorker do end it 'cancels exclusive lease after worker perform' do - expect(Gitlab::ExclusiveLease).to receive(:cancel).with(described_class::EXCLUSIVE_LEASE_KEY, exclusive_lease_uuid) worker.perform + + expect(Gitlab::ExclusiveLease.new(described_class::EXCLUSIVE_LEASE_KEY, timeout: 1.hour).exists?) + .to be_falsy end end end |