Commit a6d1e92d authored by Grzegorz Bizon's avatar Grzegorz Bizon

Isolate stage_id reference clean up migration

This addreses a review remarks discussed in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12785/diffs#note_35276344
parent a468c3a3
require 'spec_helper'
require Rails.root.join('db', 'migrate', '20170710083355_clean_stage_id_reference_migration.rb')
require Rails.root.join('db', 'post_migrate', '20170628080858_migrate_stage_id_reference_in_background')
describe CleanStageIdReferenceMigration, :migration, :sidekiq, :redis do
let(:migration) { MigrateStageIdReferenceInBackground::MIGRATION }
let(:migration) { 'MigrateBuildStageIdReference' }
context 'when there are pending background migrations' do
it 'processes pending jobs synchronously' do
Sidekiq::Testing.disable! do
BackgroundMigrationWorker.perform_in(2.minutes, migration, [1])
BackgroundMigrationWorker.perform_async(migration, [1])
BackgroundMigrationWorker.perform_in(2.minutes, migration, [1, 1])
BackgroundMigrationWorker.perform_async(migration, [1, 1])
expect(Gitlab::BackgroundMigration).to receive(:perform).twice
expect(Gitlab::BackgroundMigration)
.to receive(:perform).twice.and_call_original
migrate!
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