lib/testr/master.rb in testr-14.2.0 vs lib/testr/master.rb in testr-14.3.0

- old
+ new

@@ -15,11 +15,11 @@ branch, leaf = File.split(file) file = leaf if paths.include? branch require file.sub(/\.rb$/, '') end - @upstream.print @command_line + @client.print @command_line end def test test_file, test_names # throttle forking rate to meet the maximum concurrent workers limit sleep 1 until @command_by_worker_pid.size < Config.max_forked_workers @@ -55,11 +55,11 @@ # handled by the SIGCHLD trap registered in the master process (below) Kernel.load test_file end @command_by_worker_pid[worker_pid] = @command.push(worker_number) - @upstream.print @command_line + @client.print @command_line end def stop # NOTE: the SIGCHLD handler will reap these killed worker processes Process.kill :SIGTERM, *@command_by_worker_pid.keys.map {|pid| -pid } @@ -75,18 +75,18 @@ private @worker_number_pool = (0 ... Config.max_forked_workers).to_a @command_by_worker_pid = {} - # process exited child processes and report finished workers to upstream + # process exited child processes and report finished workers to client trap :SIGCHLD do begin while wait2_array = Process.wait2(-1, Process::WNOHANG) child_pid, child_status = wait2_array if command = @command_by_worker_pid.delete(child_pid) @worker_number_pool.push command.pop command[0] = child_status.success? ? 'pass' : 'fail' - @upstream.puts JSON.dump(command.push(child_status)) + @client.puts JSON.dump(command.push(child_status)) else warn "testr-master: unknown child exited: #{wait2_array.inspect}" end end rescue SystemCallError