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
private
def import_failure_service
@import_failure_service ||= Gitlab::ImportExport::ImportFailureService.new(@project)
Gitlab::ImportExport::ImportFailureService.new(@project)
end
def repository
@repository ||= @project.repository
@project.repository
end
end
end
......@@ -76,12 +76,12 @@ describe Projects::AfterImportService do
let(:exception) { GRPC::DeadlineExceeded.new }
before do
call_count = 0
allow(repository).to receive(:delete_all_refs_except).and_wrap_original do |original_method, *args|
call_count += 1
call_count > 1 ? original_method.call(*args) : raise(exception)
end
expect(repository)
.to receive(:delete_all_refs_except)
.and_raise(exception)
expect(repository)
.to receive(:delete_all_refs_except)
.and_call_original
subject.execute
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