summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-07-10 15:08:54 -0700
committerStan Hu <stanhu@gmail.com>2018-07-10 15:11:10 -0700
commit0c1eebe24c9717da10c6335b91273dbb73061ff8 (patch)
tree8e2b1239a9212f9151f47c7bb27c3fa1e6e5bc70 /spec
parent255db3d59792e9bac92f4327b4e324e2bd32810a (diff)
downloadgitlab-ce-0c1eebe24c9717da10c6335b91273dbb73061ff8.tar.gz
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
Diffstat (limited to 'spec')
-rw-r--r--spec/workers/git_garbage_collect_worker_spec.rb6
1 files changed, 6 insertions, 0 deletions
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