summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-09-07 19:34:59 +0000
committerDouwe Maan <douwe@gitlab.com>2017-09-07 19:34:59 +0000
commit40b0b1a391c0cd1ab9ed405c8663761e40f6defd (patch)
treeb98a416018eb147670da9c524652fe9c5ce96dca /spec/lib
parentbc955cfc8e75e17897ab25717176209fefbba915 (diff)
parent39298575a819ade6ad4f9e37a7f22592a05d21f8 (diff)
downloadgitlab-ce-40b0b1a391c0cd1ab9ed405c8663761e40f6defd.tar.gz
Merge branch '35558-only-one-garbage-collection-should-be-running-per-project-at-once' into 'master'
Adds exclusive lease to Git garbage collect worker. Closes #35558 See merge request !14036
Diffstat (limited to 'spec/lib')
-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)