From dd4b35f864e43b94532c2229e0135eaa47ddc9fe Mon Sep 17 00:00:00 2001 From: Michael Kozono Date: Sun, 26 Nov 2017 20:57:51 -0800 Subject: Fix test for MySQL --- .../background_migration/populate_untracked_uploads_spec.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb b/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb index 85da8ac5b1e..7c69755c4cf 100644 --- a/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb +++ b/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb @@ -71,8 +71,9 @@ describe Gitlab::BackgroundMigration::PopulateUntrackedUploads, :migration, :sid end it 'uses the start and end batch ids [only 1st half]' do - start_id = untracked_files_for_uploads.all.to_a[0].id - end_id = untracked_files_for_uploads.all.to_a[3].id + ids = untracked_files_for_uploads.all.order(:id).pluck(:id) + start_id = ids[0] + end_id = ids[3] expect do subject.perform(start_id, end_id) @@ -89,8 +90,9 @@ describe Gitlab::BackgroundMigration::PopulateUntrackedUploads, :migration, :sid end it 'uses the start and end batch ids [only 2nd half]' do - start_id = untracked_files_for_uploads.all.to_a[4].id - end_id = untracked_files_for_uploads.all.to_a[7].id + ids = untracked_files_for_uploads.all.order(:id).pluck(:id) + start_id = ids[4] + end_id = ids[7] expect do subject.perform(start_id, end_id) -- cgit v1.2.1