summaryrefslogtreecommitdiff
path: root/spec/migrations
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-07 15:44:47 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-07 15:45:32 +0200
commitc467451ea6f39f498b458e11b5f8a74c53d3541d (patch)
tree886bb9516b45fa738fc83f278a365cac92b8cc07 /spec/migrations
parentb41b4d2e6a44a04fc3e6fff09cf45f93033ff0ad (diff)
downloadgitlab-ce-c467451ea6f39f498b458e11b5f8a74c53d3541d.tar.gz
Schedule stage_id bg migrations in batches of 10
Diffstat (limited to 'spec/migrations')
-rw-r--r--spec/migrations/migrate_stage_id_reference_in_background_spec.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/migrations/migrate_stage_id_reference_in_background_spec.rb b/spec/migrations/migrate_stage_id_reference_in_background_spec.rb
index 90ad5c39089..e829a9238f6 100644
--- a/spec/migrations/migrate_stage_id_reference_in_background_spec.rb
+++ b/spec/migrations/migrate_stage_id_reference_in_background_spec.rb
@@ -21,7 +21,8 @@ describe MigrateStageIdReferenceInBackground, :migration, :sidekiq do
let(:projects) { table(:projects) }
before do
- stub_const("#{described_class.name}::BATCH_SIZE", 2)
+ stub_const("#{described_class.name}::BATCH_SIZE", 3)
+ stub_const("#{described_class.name}::RANGE_SIZE", 2)
projects.create!(id: 123, name: 'gitlab1', path: 'gitlab1')
projects.create!(id: 345, name: 'gitlab2', path: 'gitlab2')
@@ -48,9 +49,10 @@ describe MigrateStageIdReferenceInBackground, :migration, :sidekiq do
migrate!
expect(described_class::MIGRATION).to be_scheduled_migration(2.minutes, 1, 2)
- expect(described_class::MIGRATION).to be_scheduled_migration(4.minutes, 3, 4)
- expect(described_class::MIGRATION).to be_scheduled_migration(6.minutes, 5, 6)
- expect(BackgroundMigrationWorker.jobs.size).to eq 3
+ expect(described_class::MIGRATION).to be_scheduled_migration(2.minutes, 3, 3)
+ expect(described_class::MIGRATION).to be_scheduled_migration(4.minutes, 4, 5)
+ expect(described_class::MIGRATION).to be_scheduled_migration(4.minutes, 6, 6)
+ expect(BackgroundMigrationWorker.jobs.size).to eq 4
end
end
end