diff options
Diffstat (limited to 'spec/support/shared_examples/workers/concerns')
-rw-r--r-- | spec/support/shared_examples/workers/concerns/git_garbage_collect_methods_shared_examples.rb | 2 | ||||
-rw-r--r-- | spec/support/shared_examples/workers/concerns/reenqueuer_shared_examples.rb | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/spec/support/shared_examples/workers/concerns/git_garbage_collect_methods_shared_examples.rb b/spec/support/shared_examples/workers/concerns/git_garbage_collect_methods_shared_examples.rb index 4751d91efde..77c4a3431e2 100644 --- a/spec/support/shared_examples/workers/concerns/git_garbage_collect_methods_shared_examples.rb +++ b/spec/support/shared_examples/workers/concerns/git_garbage_collect_methods_shared_examples.rb @@ -202,6 +202,8 @@ RSpec.shared_examples 'can collect git garbage' do |update_statistics: true| before do expect(subject).to receive(:get_lease_uuid).and_return(lease_uuid) + + statistics_keys.delete(:repository_size) end it_behaves_like 'it calls Gitaly' diff --git a/spec/support/shared_examples/workers/concerns/reenqueuer_shared_examples.rb b/spec/support/shared_examples/workers/concerns/reenqueuer_shared_examples.rb index d9105981b4b..2741b2a9de7 100644 --- a/spec/support/shared_examples/workers/concerns/reenqueuer_shared_examples.rb +++ b/spec/support/shared_examples/workers/concerns/reenqueuer_shared_examples.rb @@ -19,7 +19,13 @@ RSpec.shared_examples 'reenqueuer' do describe '#perform' do it 'tries to obtain a lease' do - expect_to_obtain_exclusive_lease(subject.lease_key) + lease_key = if subject.respond_to?(:set_custom_lease_key) + subject.set_custom_lease_key(*job_args) + else + subject.lease_key + end + + expect_to_obtain_exclusive_lease(lease_key) subject_perform end |