diff options
author | Stan Hu <stanhu@gmail.com> | 2019-07-25 16:15:00 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-07-25 16:20:48 -0700 |
commit | 6fba685a275f3d2eaf69b9629cc89e76dfff75b4 (patch) | |
tree | 40d82373fe17d1c338d370ce5c22ecaa4591aa44 /spec | |
parent | 767c5f63886536eefc4daf081ecba5b45fe8cc3c (diff) | |
download | gitlab-ce-sh-ignore-git-errors-delete-project.tar.gz |
Ignore Gitaly errors if cache flushing fails on project destructionsh-ignore-git-errors-delete-project
We should just ignore these errors and move along with the deletion
since the repositories are going to be trashed anyway.
Closes https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31164
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/projects/destroy_service_spec.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/services/projects/destroy_service_spec.rb b/spec/services/projects/destroy_service_spec.rb index 3af7ee3ad50..cd762beab99 100644 --- a/spec/services/projects/destroy_service_spec.rb +++ b/spec/services/projects/destroy_service_spec.rb @@ -121,7 +121,16 @@ describe Projects::DestroyService do it { expect(Dir.exist?(remove_path)).to be_truthy } end - context 'when flushing caches fail' do + context 'when flushing caches fail due to Git errors' do + before do + allow(project.repository).to receive(:before_delete).and_raise(::Gitlab::Git::CommandError) + perform_enqueued_jobs { destroy_project(project, user, {}) } + end + + it_behaves_like 'deleting the project' + end + + context 'when flushing caches fail due to Redis' do before do new_user = create(:user) project.team.add_user(new_user, Gitlab::Access::DEVELOPER) |