diff options
Diffstat (limited to 'spec/services/projects/after_import_service_spec.rb')
-rw-r--r-- | spec/services/projects/after_import_service_spec.rb | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/spec/services/projects/after_import_service_spec.rb b/spec/services/projects/after_import_service_spec.rb index 82f654cea10..a109348ea19 100644 --- a/spec/services/projects/after_import_service_spec.rb +++ b/spec/services/projects/after_import_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Projects::AfterImportService do +RSpec.describe Projects::AfterImportService do include GitHelpers subject { described_class.new(project) } @@ -72,6 +72,26 @@ describe Projects::AfterImportService do end end + context 'when housekeeping service lease is taken' do + let(:exception) { Projects::HousekeepingService::LeaseTaken.new } + + it 'logs the error message' do + allow_next_instance_of(Projects::HousekeepingService) do |instance| + expect(instance).to receive(:execute).and_raise(exception) + end + + expect(Gitlab::Import::Logger).to receive(:info).with( + { + message: 'Project housekeeping failed', + project_full_path: project.full_path, + project_id: project.id, + 'error.message' => exception.to_s + }).and_call_original + + subject.execute + end + end + context 'when after import action throw retriable exception one time' do let(:exception) { GRPC::DeadlineExceeded.new } |