Fix ambiguous stuck ci job worker's spec. Rename lease key of archive
This commit is contained in:
parent
174c892e7e
commit
2522691eda
|
@ -215,7 +215,7 @@ module Gitlab
|
||||||
|
|
||||||
# For ExclusiveLeaseGuard concerns
|
# For ExclusiveLeaseGuard concerns
|
||||||
def lease_key
|
def lease_key
|
||||||
@lease_key ||= self.class.name.underscore + ":archive:#{job.id}"
|
@lease_key ||= "trace:archive:#{job.id}"
|
||||||
end
|
end
|
||||||
|
|
||||||
# For ExclusiveLeaseGuard concern
|
# For ExclusiveLeaseGuard concern
|
||||||
|
|
|
@ -132,8 +132,10 @@ describe StuckCiJobsWorker do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'cancels exclusive lease after worker perform' do
|
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
|
worker.perform
|
||||||
|
|
||||||
|
expect(Gitlab::ExclusiveLease.new(described_class::EXCLUSIVE_LEASE_KEY, timeout: 1.hour).exists?)
|
||||||
|
.to be_falsy
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue