diff options
author | Felipe Artur <felipefac@gmail.com> | 2019-02-15 17:11:41 -0200 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2019-02-15 17:11:41 -0200 |
commit | b1346db3a0b49b295a9702921285fdb30029563c (patch) | |
tree | 70674a6f55c0c7d1792c7b3bede76f05d2b7b811 /spec | |
parent | bf99ce7bf8bf4bda75ca57f5db4d216f3585615a (diff) | |
download | gitlab-ce-b1346db3a0b49b295a9702921285fdb30029563c.tar.gz |
Add Reschedulable module
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/background_migration/delete_diff_files_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/lib/gitlab/background_migration/delete_diff_files_spec.rb b/spec/lib/gitlab/background_migration/delete_diff_files_spec.rb index 27281333348..690881ab59b 100644 --- a/spec/lib/gitlab/background_migration/delete_diff_files_spec.rb +++ b/spec/lib/gitlab/background_migration/delete_diff_files_spec.rb @@ -40,14 +40,14 @@ describe Gitlab::BackgroundMigration::DeleteDiffFiles, :migration, :sidekiq, sch end end - it 'reschedules itself when should_wait_deadtuple_vacuum' do + it 'reschedules itself when should wait for dead tuple vacuum' do merge_request = create(:merge_request, :merged) first_diff = merge_request.merge_request_diff second_diff = merge_request.create_merge_request_diff Sidekiq::Testing.fake! do worker = described_class.new - allow(worker).to receive(:should_wait_deadtuple_vacuum?) { true } + allow(worker).to receive(:wait_for_deadtuple_vacuum?) { true } worker.perform([first_diff.id, second_diff.id]) @@ -57,10 +57,10 @@ describe Gitlab::BackgroundMigration::DeleteDiffFiles, :migration, :sidekiq, sch end end - describe '#should_wait_deadtuple_vacuum?' do + describe '#wait_for_deadtuple_vacuum?' do it 'returns true when hitting merge_request_diff_files hits DEAD_TUPLES_THRESHOLD', :postgresql do worker = described_class.new - threshold_query_result = [{ "n_dead_tup" => described_class::DEAD_TUPLES_THRESHOLD.to_s }] + threshold_query_result = [{ "n_dead_tup" => 50_000 }] normal_query_result = [{ "n_dead_tup" => '3' }] allow(worker) @@ -68,7 +68,7 @@ describe Gitlab::BackgroundMigration::DeleteDiffFiles, :migration, :sidekiq, sch .with(/SELECT n_dead_tup */) .and_return(threshold_query_result, normal_query_result) - expect(worker.should_wait_deadtuple_vacuum?).to be(true) + expect(worker.wait_for_deadtuple_vacuum?('merge_request_diff_files')).to be(true) end end end |