Skip to content
Snippets Groups Projects
Commit f917fc5d authored by Michael Kozono's avatar Michael Kozono
Browse files

Fix last batch size equals max batch size error

parent bbfec704
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -92,7 +92,7 @@ module Gitlab
end
end
 
yield(paths)
yield(paths) if paths.any?
end
 
def build_find_command(search_dir)
Loading
Loading
Loading
Loading
@@ -133,6 +133,18 @@ describe Gitlab::BackgroundMigration::PrepareUntrackedUploads, :sidekiq do
context 'when there are files in /uploads/tmp' do
it_behaves_like 'does not add files in /uploads/tmp'
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
 
Loading
Loading
@@ -205,6 +217,18 @@ describe Gitlab::BackgroundMigration::PrepareUntrackedUploads, :sidekiq do
context 'when there are files in /uploads/tmp' do
it_behaves_like 'does not add files in /uploads/tmp'
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
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment