From 246e687384baa0c51a67ce1b41e69b736334170c Mon Sep 17 00:00:00 2001 From: Zarif Mahfuz Date: Wed, 17 Apr 2024 17:09:45 -0600 Subject: [PATCH] Run the failing test after every test in the test order --- ruby/lib/ci/queue/bisect.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ruby/lib/ci/queue/bisect.rb b/ruby/lib/ci/queue/bisect.rb index 664e45b4..5c74bcf8 100644 --- a/ruby/lib/ci/queue/bisect.rb +++ b/ruby/lib/ci/queue/bisect.rb @@ -6,6 +6,7 @@ def initialize(path, config) @tests = ::File.readlines(path).map(&:strip).reject(&:empty?).take_while { |t| t != config.failing_test } @config = config @iterator = 0 + @leaky_index = nil end def size @@ -21,6 +22,7 @@ def to_a end def suspects_left + return 0 if @leaky_index != nil and @leaky_index >= 0 @tests.size - @iterator end @@ -30,8 +32,11 @@ def failing_test def candidates # Static.new(first_half + [config.failing_test], config).populate(@all_tests) + if @leaky_index != nil and @leaky_index >= 0 + return Static.new(@tests[@leaky_index] + [config.failing_test], config).populate(@all_tests) + end @iterator += 1 - Static.new(@tests.first(@iterator) + [config.failing_test], config).populate(@all_tests) + Static.new(@tests[@iterator] + [config.failing_test], config).populate(@all_tests) end def release! @@ -40,7 +45,7 @@ def release! def failed! # @tests = first_half - @tests = @tests.first(@iterator) + @leaky_index = @iterator end def succeeded!