diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-10-03 17:39:04 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2018-02-23 18:17:48 +0300 |
commit | e610f9604ecd186ae37862894a4f4b7c706d0ce5 (patch) | |
tree | 868f1f81c5bb490d78943193bfe885de56e09b0e /spec/workers/stuck_import_jobs_worker_spec.rb | |
parent | 58a312f5097b30a93100de93d06427402d514b48 (diff) |
Adds scheduled import jobs to the stuck import jobs detection worker.
Diffstat (limited to 'spec/workers/stuck_import_jobs_worker_spec.rb')
-rw-r--r-- | spec/workers/stuck_import_jobs_worker_spec.rb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/spec/workers/stuck_import_jobs_worker_spec.rb b/spec/workers/stuck_import_jobs_worker_spec.rb index a82eb54ffe4..ae24a3f65ac 100644 --- a/spec/workers/stuck_import_jobs_worker_spec.rb +++ b/spec/workers/stuck_import_jobs_worker_spec.rb @@ -8,9 +8,7 @@ describe StuckImportJobsWorker do allow_any_instance_of(Gitlab::ExclusiveLease).to receive(:try_obtain).and_return(exclusive_lease_uuid) end - describe 'with started import_status' do - let(:project) { create(:project, :import_started, import_jid: '123') } - + shared_examples 'project import job detection' do describe 'long running import' do it 'marks the project as failed' do allow(Gitlab::SidekiqStatus).to receive(:completed_jids).and_return(['123']) @@ -33,4 +31,16 @@ describe StuckImportJobsWorker do end end end + + describe 'with scheduled import_status' do + it_behaves_like 'project import job detection' do + let(:project) { create(:project, :import_scheduled, import_jid: '123') } + end + end + + describe 'with started import_status' do + it_behaves_like 'project import job detection' do + let(:project) { create(:project, :import_started, import_jid: '123') } + end + end end |