Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/workers/bulk_imports/relation_batch_export_worker_spec.rb')
-rw-r--r--spec/workers/bulk_imports/relation_batch_export_worker_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/workers/bulk_imports/relation_batch_export_worker_spec.rb b/spec/workers/bulk_imports/relation_batch_export_worker_spec.rb
index e27e2dc0ac8..8ee55d64a1b 100644
--- a/spec/workers/bulk_imports/relation_batch_export_worker_spec.rb
+++ b/spec/workers/bulk_imports/relation_batch_export_worker_spec.rb
@@ -23,4 +23,21 @@ RSpec.describe BulkImports::RelationBatchExportWorker, feature_category: :import
end
end
end
+
+ describe '.sidekiq_retries_exhausted' do
+ let(:job) { { 'args' => job_args } }
+
+ it 'sets export status to failed and tracks the exception' do
+ portable = batch.export.portable
+
+ expect(Gitlab::ErrorTracking)
+ .to receive(:track_exception)
+ .with(kind_of(StandardError), portable_id: portable.id, portable_type: portable.class.name)
+
+ described_class.sidekiq_retries_exhausted_block.call(job, StandardError.new('*' * 300))
+
+ expect(batch.reload.failed?).to eq(true)
+ expect(batch.error.size).to eq(255)
+ end
+ end
end