Commit 6180d91a authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch '199985-follow-up-retry-after-import' into 'master'

Follow up for retry after import

Closes #199985

See merge request gitlab-org/gitlab!24281
parents ee97aba0 c1178654
...@@ -29,11 +29,11 @@ module Projects ...@@ -29,11 +29,11 @@ module Projects
private private
def import_failure_service def import_failure_service
@import_failure_service ||= Gitlab::ImportExport::ImportFailureService.new(@project) Gitlab::ImportExport::ImportFailureService.new(@project)
end end
def repository def repository
@repository ||= @project.repository @project.repository
end end
end end
end end
...@@ -76,12 +76,12 @@ describe Projects::AfterImportService do ...@@ -76,12 +76,12 @@ describe Projects::AfterImportService do
let(:exception) { GRPC::DeadlineExceeded.new } let(:exception) { GRPC::DeadlineExceeded.new }
before do before do
call_count = 0 expect(repository)
.to receive(:delete_all_refs_except)
allow(repository).to receive(:delete_all_refs_except).and_wrap_original do |original_method, *args| .and_raise(exception)
call_count += 1 expect(repository)
call_count > 1 ? original_method.call(*args) : raise(exception) .to receive(:delete_all_refs_except)
end .and_call_original
subject.execute subject.execute
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment