Skip to content

Commit

Permalink
Merge pull request #240 from Shopify/cbruckmayer/instrument-leader-el…
Browse files Browse the repository at this point in the history
…ection

Exit with status 40 when no master elected
  • Loading branch information
ChrisBr authored Oct 3, 2023
2 parents c153fcf + 826fe6c commit d05e1a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ruby/lib/minitest/queue/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def report_command

unless supervisor.wait_for_workers { display_warnings(supervisor.build) }
unless supervisor.queue_initialized?
abort! "No master was elected. Did all workers crash?"
abort! "No master was elected. Did all workers crash?", 40
end

unless supervisor.exhausted?
Expand Down Expand Up @@ -623,10 +623,10 @@ def exit!(*)
super
end

def abort!(message)
def abort!(message, exit_status=1)
reopen_previous_step
puts red(message)
exit! 1 # exit! is required to avoid minitest at_exit callback
exit! exit_status # exit! is required to avoid minitest at_exit callback
end

def retry?
Expand Down

0 comments on commit d05e1a8

Please sign in to comment.