Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-13 12:44:52 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-13 12:44:52 +0300
commit2a0ead2c4730110c898127660fe6600155539f0c (patch)
tree35d9ac1ab2f78a227e6bfeb542c309711bb3d558 /spec/lib/gitlab/background_migration_spec.rb
parent388abbd10c043b4cc406fa717e05dd81b0858c02 (diff)
Implement draining scheduled sets of background migrations
Diffstat (limited to 'spec/lib/gitlab/background_migration_spec.rb')
-rw-r--r--spec/lib/gitlab/background_migration_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/gitlab/background_migration_spec.rb b/spec/lib/gitlab/background_migration_spec.rb
index 93ffaab65ce..d823c5342ae 100644
--- a/spec/lib/gitlab/background_migration_spec.rb
+++ b/spec/lib/gitlab/background_migration_spec.rb
@@ -34,6 +34,20 @@ describe Gitlab::BackgroundMigration do
described_class.steal('Bar')
end
end
+
+ context 'when there are scheduled jobs present', :sidekiq, :redis do
+ it 'steals all jobs from the schedule sets' do
+ Sidekiq::Testing.disable! do
+ BackgroundMigrationWorker.perform_in(10.minutes, 'Object')
+ expect(Sidekiq::ScheduledSet.new).to be_one
+ expect(described_class).to receive(:perform).with('Object', any_args)
+
+ described_class.steal('Object')
+
+ expect(Sidekiq::ScheduledSet.new).to be_none
+ end
+ end
+ end
end
describe '.perform' do