Skip to content

Commit 9912e28

Browse files
committed
Fix argument error
1 parent 9b76034 commit 9912e28

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎ruby/lib/ci/queue/redis/worker.rb‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ def populate(tests, random: Random.new)
4040
@index = tests.map { |t| [t.id, t] }.to_h
4141
@total = tests.size
4242
@random = random
43+
@tests = tests
4344

44-
execute_master_setup(tests) if acquire_master_role?
45+
execute_master_setup if acquire_master_role?
4546

4647
register_worker_presence
4748

@@ -543,7 +544,7 @@ def acquire_master_role?
543544
def attempt_master_takeover
544545
return false if @master # Already master
545546

546-
warn "Worker #{worker_id} attempting to takeover as master"
547+
warn "Worker #{worker_id} attempting to takeover as master from #{master_worker_id}"
547548

548549
current_time = CI::Queue.time_now.to_f
549550
result = eval_script(
@@ -586,7 +587,7 @@ def register_worker_presence
586587
def execute_master_setup(tests)
587588
return unless @master && @index
588589
with_master_setup_heartbeat do
589-
executables = reorder_tests(tests, random: @random)
590+
executables = reorder_tests(@tests, random: @random)
590591

591592
chunks = executables.select { |e| e.is_a?(CI::Queue::TestChunk) }
592593
individual_tests = executables.reject { |e| e.is_a?(CI::Queue::TestChunk) }

0 commit comments

Comments
 (0)