From 0c1eebe24c9717da10c6335b91273dbb73061ff8 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 10 Jul 2018 15:08:54 -0700 Subject: Fix ArgumentError in GitGarbageCollectWorker Sidekiq job When the Gitaly call failed, the exception handling failed because `method` is expected to have a parameter. Closes #49096 --- spec/workers/git_garbage_collect_worker_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec') diff --git a/spec/workers/git_garbage_collect_worker_spec.rb b/spec/workers/git_garbage_collect_worker_spec.rb index e39dec556fc..d5808e21271 100644 --- a/spec/workers/git_garbage_collect_worker_spec.rb +++ b/spec/workers/git_garbage_collect_worker_spec.rb @@ -27,6 +27,12 @@ describe GitGarbageCollectWorker do subject.perform(project.id, :gc, lease_key, lease_uuid) end + + it 'handles gRPC errors' do + expect_any_instance_of(Gitlab::GitalyClient::RepositoryService).to receive(:garbage_collect).and_raise(GRPC::NotFound) + + expect { subject.perform(project.id, :gc, lease_key, lease_uuid) }.to raise_exception(Gitlab::Git::Repository::NoRepository) + end end context 'with different lease than the active one' do -- cgit v1.2.1