diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2018-06-28 21:51:36 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2018-06-29 01:24:40 +0300 |
commit | 34dbccb24b38c5a7c52641e7008f3ab53b25c66a (patch) | |
tree | 4b5121120fe3973729e546fd3e25a0a4f6106ea9 /spec/support/shared_examples/ci_trace_shared_examples.rb | |
parent | e38af20cc6eae4f001fd98b0450f00f496a278d0 (diff) |
Add helper methods to stub Gitlab::ExclusiveLease
Diffstat (limited to 'spec/support/shared_examples/ci_trace_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/ci_trace_shared_examples.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/support/shared_examples/ci_trace_shared_examples.rb b/spec/support/shared_examples/ci_trace_shared_examples.rb index 6dbe0f6f980..db723a323f8 100644 --- a/spec/support/shared_examples/ci_trace_shared_examples.rb +++ b/spec/support/shared_examples/ci_trace_shared_examples.rb @@ -247,8 +247,10 @@ shared_examples_for 'common trace features' do end context 'when another process has already been archiving', :clean_gitlab_redis_shared_state do + include ExclusiveLeaseHelpers + before do - Gitlab::ExclusiveLease.new("trace:archive:#{trace.job.id}", timeout: 1.hour).try_obtain + stub_exclusive_lease_taken("trace:archive:#{trace.job.id}", timeout: 1.hour) end it 'blocks concurrent archiving' do |