summaryrefslogtreecommitdiff
path: root/spec/migrations/delete_conflicting_redirect_routes_spec.rb
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2017-09-11 12:20:04 -0700
committerMichael Kozono <mkozono@gmail.com>2017-09-14 14:17:23 -0700
commitc9232087218e03a5eb880e4b4fabe7d0f5a23727 (patch)
tree0ecc55f90d1e8f7b082e7298c55adf226d34b20e /spec/migrations/delete_conflicting_redirect_routes_spec.rb
parentee4f73916f586112e6479d80b3769e174414eb7e (diff)
downloadgitlab-ce-c9232087218e03a5eb880e4b4fabe7d0f5a23727.tar.gz
Spread out the work a little
Diffstat (limited to 'spec/migrations/delete_conflicting_redirect_routes_spec.rb')
-rw-r--r--spec/migrations/delete_conflicting_redirect_routes_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/migrations/delete_conflicting_redirect_routes_spec.rb b/spec/migrations/delete_conflicting_redirect_routes_spec.rb
index b79d04c1a21..cf872595f21 100644
--- a/spec/migrations/delete_conflicting_redirect_routes_spec.rb
+++ b/spec/migrations/delete_conflicting_redirect_routes_spec.rb
@@ -5,6 +5,10 @@ describe DeleteConflictingRedirectRoutes, :migration, :sidekiq do
let!(:redirect_routes) { table(:redirect_routes) }
let!(:routes) { table(:routes) }
+ around do |example|
+ Timecop.freeze { example.run }
+ end
+
before do
stub_const("Gitlab::Database::MigrationHelpers::BACKGROUND_MIGRATION_BATCH_SIZE", 2)
stub_const("Gitlab::Database::MigrationHelpers::BACKGROUND_MIGRATION_JOB_BUFFER_SIZE", 2)
@@ -34,8 +38,11 @@ describe DeleteConflictingRedirectRoutes, :migration, :sidekiq do
migrate!
expect(BackgroundMigrationWorker.jobs[0]['args']).to eq([described_class::MIGRATION, [1, 2]])
+ expect(BackgroundMigrationWorker.jobs[0]['at']).to eq(1.minute.from_now.to_f)
expect(BackgroundMigrationWorker.jobs[1]['args']).to eq([described_class::MIGRATION, [3, 4]])
+ expect(BackgroundMigrationWorker.jobs[1]['at']).to eq(2.minutes.from_now.to_f)
expect(BackgroundMigrationWorker.jobs[2]['args']).to eq([described_class::MIGRATION, [5, 5]])
+ expect(BackgroundMigrationWorker.jobs[2]['at']).to eq(3.minutes.from_now.to_f)
expect(BackgroundMigrationWorker.jobs.size).to eq 3
end
end