2020-06-23 00:09:42 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Gitlab::Import::StuckProjectImportJobsWorker do
|
2020-06-23 00:09:42 +05:30
|
|
|
let(:worker) { described_class.new }
|
|
|
|
|
|
|
|
describe 'with scheduled import_status' do
|
|
|
|
it_behaves_like 'stuck import job detection' do
|
|
|
|
let(:import_state) { create(:project, :import_scheduled).import_state }
|
|
|
|
|
|
|
|
before do
|
2020-10-24 23:57:45 +05:30
|
|
|
import_state.update!(jid: '123')
|
2020-06-23 00:09:42 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'with started import_status' do
|
|
|
|
it_behaves_like 'stuck import job detection' do
|
|
|
|
let(:import_state) { create(:project, :import_started).import_state }
|
|
|
|
|
|
|
|
before do
|
2020-10-24 23:57:45 +05:30
|
|
|
import_state.update!(jid: '123')
|
2020-06-23 00:09:42 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|