Skip to content

Commit

Permalink
Only process retry queue on manual retries
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisBr committed Mar 26, 2024
1 parent fc08f5f commit 6ff6474
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ruby/lib/minitest/queue/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def retry_command

def run_command
require_worker_id!
if queue.retrying? || retry?
# if it's an automatic job retry we should process the main queue
if (queue.retrying? || retry?) && manual_retry?
if queue.expired?
abort! "The test run is too old and can't be retried"
end
Expand Down Expand Up @@ -665,6 +666,12 @@ def abort!(message, exit_status=1)
exit! exit_status # exit! is required to avoid minitest at_exit callback
end

def manual_retry?
# this env variable only exists on Buildkite so we should default to manual for backward compatibility
retry? &&
ENV.fetch("BUILDKITE_RETRY_TYPE", "manual") == "manual"
end

def retry?
ENV["BUILDKITE_RETRY_COUNT"].to_i > 0 ||
ENV["SEMAPHORE_PIPELINE_RERUN"] == "true"
Expand Down

0 comments on commit 6ff6474

Please sign in to comment.