Wait for all workers to complete their tests and print output.
423415
private function waitForAllToFinish(): void
    {
        do {
            foreach ($this->workers as $key => $worker) {
                if (!$worker->isRunning()) {
                    unset($this->workers[$key]);
                }
            }
            usleep(10000);
            $this->printOutput();
        } while (\count($this->workers) > 0);
    }
1142469
def _wait_for_finishing(self):
        """"""
        self.state_machine_running = True
        self.__running_state_machine.join()
        self.__set_execution_mode_to_finished()
        self.state_machine_manager.active_state_machine_id = None
        plugins.run_on_state_machine_execution_finished()
        # self.__set_execution_mode_to_stopped()
        self.state_machine_running = False
599183
def wait_until(message='completed!')
      3.times { dot_and_sleep(1) }
      begin
        dot_and_sleep(2) until yield
      rescue Excon::Errors::SocketError => e
        # print out the error so the user can interrupt if necessary
        print "#{e.class}: #{e.message}! Retry:"
        sleep(1)
        retry
      end
      puts message
    end
762737
def wait_until_done(opts={})
      raise "Threadz: thread deadlocked because batch job was never started" if @latent && !@started

      timeout = opts.key?(:timeout) ? opts[:timeout] : 0
      @sleeper.wait(timeout) unless completed?
      errors = self.job_errors
      if !errors.empty? && !@error_handler
        raise JobError.new(errors)
      end
    end
541858
def wait(self):
        '''
        '''
        status = self.proc.wait()
        if status >= 0:
            self.exitstatus = status
            self.signalstatus = None
        else:
            self.exitstatus = None
            self.signalstatus = -status
        self.terminated = True
        return status
1356658
public function wait()
    {
        $pid = $this->getSupervisorPid();
        if (!empty($pid)) {
            while ($this->isProcessRunning($pid)) {
                sleep(1);
            }
        }
    }
84045
def wait_for_workers(self, min_n_workers=1):
		
	
		self.logger.debug('wait_for_workers trying to get the condition')
		with self.thread_cond:
			while (self.dispatcher.number_of_workers() < min_n_workers):
				self.logger.debug('HBMASTER: only %i worker(s) available, waiting for at least %i.'%(self.dispatcher.number_of_workers(), min_n_workers))
				self.thread_cond.wait(1)
				self.dispatcher.trigger_discover_worker()
				
		self.logger.debug('Enough workers to start this run!')
1295822
def _wait(jid):
    '''
    
    '''
    if jid is None:
        jid = salt.utils.jid.gen_jid(__opts__)
    states = _prior_running_states(jid)
    while states:
        time.sleep(1)
        states = _prior_running_states(jid)
839259
public function waitForFinishedJob()
    {
        if ($this->inExecution === 0) {
            return;
        }
        $tellsUsItHasFinished = false;
        stream_set_blocking($this->pipes[1], true);
        while ($line = fgets($this->pipes[1])) {
            if (strstr($line, "FINISHED\n")) {
                $tellsUsItHasFinished = true;
                --$this->inExecution;
                break;
            }
        }
        if (!$tellsUsItHasFinished) {
            throw new \RuntimeException('The Worker terminated without finishing the job.');
        }
    }
1212193
def wait_on_job(self, job_id):
        """"""

        while True:
            status = self.get_job_status(job_id)
            if status == 'SUCCEEDED':
                logger.info('Batch job {} SUCCEEDED'.format(job_id))
                return True
            elif status == 'FAILED':
                # Raise and notify if job failed
                jobs = self._client.describe_jobs(jobs=[job_id])['jobs']
                job_str = json.dumps(jobs, indent=4)
                logger.debug('Job details:\n' + job_str)

                log_stream_name = jobs[0]['attempts'][0]['container']['logStreamName']
                logs = self.get_logs(log_stream_name)
                raise BatchJobException('Job {} failed: {}'.format(
                    job_id, logs))

            time.sleep(self.poll_time)
            logger.debug('Batch job status for job {0}: {1}'.format(
                job_id, status))
763742
def _callback(self, bjobid, result, grade, problems, tests, custom, archive, stdout, stderr):
        
        self._jobs_done[str(bjobid)] = (result, grade, problems, tests, custom, archive, stdout, stderr)
        self._waiting_jobs.remove(str(bjobid))
416699
def reap_workers(waitpidflags = 0)
      loop do
        worker_pid, status = Process.waitpid2(-1, waitpidflags)
        if worker_pid.nil?
          return :none_ready
        else
          log "Worker exited #{status}"
          finish_worker(worker_pid, status)
          report_to_master("-#{worker_pid}")
        end
      end
    rescue Errno::ECHILD
      # All done
      :no_child
    end
220357
def chimpd_wait_until_done
      local_queue = ChimpQueue.instance
      $stdout.print "Waiting for chimpd jobs to complete for group #{@group}..."

      begin
        while !@dry_run
          local_queue = ChimpQueue.instance
          #
          # load up remote chimpd jobs into the local queue
          # this makes all the standard queue control methods available to us
          #
          sleeping_counter = 0
          while true
            local_queue.reset!

            begin
              all = ChimpDaemonClient.retrieve_group_info(@chimpd_host, @chimpd_port, @group, :all)
            rescue RestClient::ResourceNotFound
              sleep 5
              $stdout.print "\nINFO: Waiting on group #{@group} to populate"
              retry
            end

            ChimpQueue.instance.create_group(@group)
            ChimpQueue[@group].set_jobs(all)

            if ChimpQueue[@group].done?
              Log.debug 'Group ' + @group.to_s + ' is completed'
              jobs = ChimpQueue[@group].size
              $stdout.print "\nINFO: Group #{@group} has completed (#{jobs} jobs)"
              break
            else
              Log.debug 'Group ' + @group.to_s + ' is not done.'
            end

            if sleeping_counter % 240 == 0
              $stdout.print "\n(Still) Waiting for group #{@group}" unless sleeping_counter == 0
            end
            $stdout.print "."
            $stdout.flush
            sleeping_counter += 5
            sleep 5
          end

          #
          # If verify_results returns false, then ask chimpd to requeue all failed jobs.
          #
          case verify_results(@group)
          when 'continue'
            break
          when 'retry'
            ChimpDaemonClient.retry_group(@chimpd_host, @chimpd_port, @group)
          when 'pause'
            @paused = true
            #stuck in this loop until action is taken
          end
        end
      ensure
        #$stdout.print " done\n"
      end
    end
303598
async def wait_nodes(self, timeout, check_ready=True):
        
        return await self.wait_slaves(timeout, check_ready=check_ready)
42402
def finish(status, stdout, stderr, passed, pending, failed)
      RRRSpec.redis.hmset(
        key,
        'finished_at', Time.zone.now.to_s,
        'status', status,
        'stdout', stdout,
        'stderr', stderr,
        'passed', passed,
        'pending', pending,
        'failed', failed
      )
    end
723127
def wait(self) -> None:
        """"""
        if self._out_thread.is_alive():
            self._out_thread.join()
        if self._err_thread.is_alive():
            self._err_thread.join()

        # Handle case where the process ended before the last read could be done.
        # This will return None for the streams that weren't pipes.
        out, err = self._proc.communicate()

        if out:
            self._write_bytes(self._stdout, out)
        if err:
            self._write_bytes(self._stderr, err)
356285
def wait_until_finished(self):
        """"""
        try:
            self.thread.join()
        except KeyboardInterrupt:
            self._logger.debug('Keyboard interrupt detected, stopping driver.')
            self._active = False
            self._wake_queue()