diff options
author | Robert Speicher <robert@gitlab.com> | 2018-07-11 02:13:50 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-07-11 02:13:50 +0300 |
commit | c2a0a3ab1aed9814c1044c753b3f31b29b6142b1 (patch) | |
tree | aa819b265156a17ebbe31af15c152c1ebefa70e4 /spec | |
parent | 9e72e5e65354b1e0ecde126d754fd863ac8f38b0 (diff) | |
parent | 0c1eebe24c9717da10c6335b91273dbb73061ff8 (diff) |
Merge branch 'sh-fix-git-gc-error-handling' into 'master'
Fix ArgumentError in GitGarbageCollectWorker Sidekiq job
Closes #49096
See merge request gitlab-org/gitlab-ce!20541
Diffstat (limited to 'spec')
-rw-r--r-- | spec/workers/git_garbage_collect_worker_spec.rb | 6 |
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 |