diff options
author | Felipe Artur <felipefac@gmail.com> | 2019-03-01 16:24:47 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2019-03-01 16:24:47 -0300 |
commit | 294c5c41beaac1fbc60c67df2c8745f7583544a1 (patch) | |
tree | 2559085daf704a40e749288fa9b4bfeed313f725 /spec | |
parent | 7bd066a1fa51018211e26ca0c5624aecbc364a66 (diff) | |
download | gitlab-ce-294c5c41beaac1fbc60c67df2c8745f7583544a1.tar.gz |
Remove auto vacuum logic, decrease batch size and interval
Diffstat (limited to 'spec')
-rw-r--r-- | spec/migrations/schedule_sync_issuables_state_id_spec.rb | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/spec/migrations/schedule_sync_issuables_state_id_spec.rb b/spec/migrations/schedule_sync_issuables_state_id_spec.rb index 6c4c31ae554..6b1ea804342 100644 --- a/spec/migrations/schedule_sync_issuables_state_id_spec.rb +++ b/spec/migrations/schedule_sync_issuables_state_id_spec.rb @@ -26,33 +26,14 @@ describe ScheduleSyncIssuablesStateId, :migration do Timecop.freeze do migrate! - expect(migration).to be_scheduled_delayed_migration(5.minutes, resource_1.id, resource_2.id) - expect(migration).to be_scheduled_delayed_migration(10.minutes, resource_3.id, resource_4.id) + expect(migration).to be_scheduled_delayed_migration(120.seconds, resource_1.id, resource_2.id) + expect(migration).to be_scheduled_delayed_migration(240.seconds, resource_3.id, resource_4.id) expect(BackgroundMigrationWorker.jobs.size).to eq(2) end end end end - shared_examples 'rescheduling migrations' do - before do - Sidekiq::Worker.clear_all - end - - it 'reschedules migrations when should wait for dead tuple vacuum' do - worker = worker_class.new - - Sidekiq::Testing.fake! do - allow(worker).to receive(:wait_for_deadtuple_vacuum?) { true } - - worker.perform(resource_1.id, resource_2.id) - - expect(worker_class.name.demodulize).to be_scheduled_delayed_migration(5.minutes, resource_1.id, resource_2.id) - expect(BackgroundMigrationWorker.jobs.size).to eq(1) - end - end - end - describe '#up' do context 'issues' do it 'migrates state column to integer' do @@ -76,12 +57,6 @@ describe ScheduleSyncIssuablesStateId, :migration do let!(:resource_3) { issues.create!(description: 'third', state: 'closed') } let!(:resource_4) { issues.create!(description: 'fourth', state: 'closed') } end - - it_behaves_like 'rescheduling migrations' do - let(:worker_class) { Gitlab::BackgroundMigration::SyncIssuesStateId } - let!(:resource_1) { issues.create!(description: 'first', state: 'opened') } - let!(:resource_2) { issues.create!(description: 'second', state: 'closed') } - end end context 'merge requests' do @@ -108,12 +83,6 @@ describe ScheduleSyncIssuablesStateId, :migration do let!(:resource_3) { merge_requests.create!(state: 'merged', target_project_id: @project.id, target_branch: 'feature3', source_branch: 'master') } let!(:resource_4) { merge_requests.create!(state: 'locked', target_project_id: @project.id, target_branch: 'feature4', source_branch: 'master') } end - - it_behaves_like 'rescheduling migrations' do - let(:worker_class) { Gitlab::BackgroundMigration::SyncMergeRequestsStateId } - let(:resource_1) { merge_requests.create!(state: 'opened', target_project_id: @project.id, target_branch: 'feature1', source_branch: 'master') } - let(:resource_2) { merge_requests.create!(state: 'closed', target_project_id: @project.id, target_branch: 'feature2', source_branch: 'master') } - end end end end |