BigW Consortium Gitlab

Commit 04721479 by Michael Kozono

Fix last batch size equals max batch size error

parent bf7412e4
...@@ -88,7 +88,7 @@ module Gitlab ...@@ -88,7 +88,7 @@ module Gitlab
end end
end end
yield(paths) yield(paths) if paths.any?
end end
def build_find_command(search_dir) def build_find_command(search_dir)
......
...@@ -128,6 +128,18 @@ describe Gitlab::BackgroundMigration::PrepareUntrackedUploads, :sidekiq do ...@@ -128,6 +128,18 @@ describe Gitlab::BackgroundMigration::PrepareUntrackedUploads, :sidekiq do
expect(untracked_files_for_uploads.count).to eq(5) expect(untracked_files_for_uploads.count).to eq(5)
end end
end end
context 'when the last batch size exactly matches the max batch size' do
it 'does not raise error' do
stub_const("#{described_class}::FIND_BATCH_SIZE", 5)
expect do
described_class.new.perform
end.not_to raise_error
expect(untracked_files_for_uploads.count).to eq(5)
end
end
end end
end end
...@@ -216,6 +228,18 @@ describe Gitlab::BackgroundMigration::PrepareUntrackedUploads, :sidekiq do ...@@ -216,6 +228,18 @@ describe Gitlab::BackgroundMigration::PrepareUntrackedUploads, :sidekiq do
expect(untracked_files_for_uploads.count).to eq(5) expect(untracked_files_for_uploads.count).to eq(5)
end end
end end
context 'when the last batch size exactly matches the max batch size' do
it 'does not raise error' do
stub_const("#{described_class}::FIND_BATCH_SIZE", 5)
expect do
described_class.new.perform
end.not_to raise_error
expect(untracked_files_for_uploads.count).to eq(5)
end
end
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment