From 7c0972ba11d95e506ab9ce786934af0aa5b95a67 Mon Sep 17 00:00:00 2001 From: Christian Bruckmayer Date: Tue, 11 Apr 2023 11:39:18 +0100 Subject: [PATCH] Allow passing in an empty order file --- ruby/lib/ci/queue/bisect.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ruby/lib/ci/queue/bisect.rb b/ruby/lib/ci/queue/bisect.rb index 2a43e875..f877bfb5 100644 --- a/ruby/lib/ci/queue/bisect.rb +++ b/ruby/lib/ci/queue/bisect.rb @@ -48,7 +48,10 @@ def succeeded! attr_reader :config def slices - @tests.each_slice((@tests.size / 2.0).ceil).to_a + slice_size = (@tests.size / 2.0).ceil + return [[], []] if slice_size <= 0 + + @tests.each_slice(slice_size).to_a end def first_half