summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2017-09-04 18:55:04 +0100
committerTiago Botelho <tiagonbotelho@hotmail.com>2017-09-07 18:52:04 +0100
commit39298575a819ade6ad4f9e37a7f22592a05d21f8 (patch)
tree43319ff3c1bb533e20c5185571aa7341be984f31 /spec/lib/gitlab
parent21935d85382989e38dd4cc12de55966e0c9b6eba (diff)
downloadgitlab-ce-39298575a819ade6ad4f9e37a7f22592a05d21f8.tar.gz
Adds exclusive lease to Git garbage collect worker.35558-only-one-garbage-collection-should-be-running-per-project-at-once
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r--spec/lib/gitlab/exclusive_lease_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/lib/gitlab/exclusive_lease_spec.rb b/spec/lib/gitlab/exclusive_lease_spec.rb
index c1ed47cf64a..7322a326b01 100644
--- a/spec/lib/gitlab/exclusive_lease_spec.rb
+++ b/spec/lib/gitlab/exclusive_lease_spec.rb
@@ -47,6 +47,18 @@ describe Gitlab::ExclusiveLease, :clean_gitlab_redis_shared_state do
end
end
+ describe '.get_uuid' do
+ it 'gets the uuid if lease with the key associated exists' do
+ uuid = described_class.new(unique_key, timeout: 3600).try_obtain
+
+ expect(described_class.get_uuid(unique_key)).to eq(uuid)
+ end
+
+ it 'returns false if the lease does not exist' do
+ expect(described_class.get_uuid(unique_key)).to be false
+ end
+ end
+
describe '.cancel' do
it 'can cancel a lease' do
uuid = new_lease(unique_key)