Wait until port is up and running, including all parameters (admin state, oper state, license etc.).

        :param timeout: max time to wait for port up.
439003
def wait_for_up(self, timeout=40):
        

        self.wait_for_states(timeout, 'up')
        connectionStatus = self.get_attribute('connectionStatus').strip()
        if connectionStatus.split(':')[0] != self.get_attribute('assignedTo').split(':')[0]:
            raise TgnError('Failed to reach up state, port connection status is {} after {} seconds'.
                           format(connectionStatus, timeout))
496266
def _wait(self, timeout=None):
        
        r, w, x = select.select([self._stick_file], [], [], timeout)
        return bool(r)
1100018
public final void waitForPort(final String portName, final int timeout, final TimeUnit unit) {
        final Binding binding = getPortBinding(portName);
        waitForPort(binding.getHost(), binding.getPort(), timeout, unit);
    }
923793
def wait(self, timeout=None):
    

    def cond(self):
      return self.__state not in (Job.PENDING, Job.RUNNING) or self.__cancelled
    if not wait_for_condition(self, cond, timeout):
      raise Job.Timeout
    return self.result
132815
def wait_for_service_available(container, url, timeout):
    
    start = time.time()
    remaining = timeout
    while True:
        remaining = start + timeout - time.time()
        if remaining < 0:
            raise ServiceTimeout
        try:
            response = get(url,
                timeout=min(remaining, REQUEST_TIMEOUT_SECONDS))
            if 500 <= response.status_code < 600:
                return False
            return True
        except (ConnectionError, Timeout):
            pass
        if not inspect_container(container)['State']['Running']:
            return False

        remaining = start + timeout - time.time()
        delay = max(0, min(RETRY_DELAY_SECONDS, remaining))
        time.sleep(delay)

    raise ServiceTimeout
288813
def wait(self):
    ""
    data=self.getcon().recv(256) # this can raise socket.timeout
    if not data: raise PubsubDisco
    if self.reset:
      self.reset=False # i.e. ack it. reset is used to tell the wait-thread there was a reconnect (though it's plausible that this never happens)
      raise PubsubDisco
    self.buf+=data
    msg,self.buf=complete_message(self.buf)
    return msg
974232
def wait_for_state(vmid, state, timeout=300):
    '''
    
    '''
    start_time = time.time()
    node = get_vm_status(vmid=vmid)
    if not node:
        log.error('wait_for_state: No VM retrieved based on given criteria.')
        raise SaltCloudExecutionFailure

    while True:
        if node['status'] == state:
            log.debug('Host %s is now in "%s" state!', node['name'], state)
            return True
        time.sleep(1)
        if time.time() - start_time > timeout:
            log.debug('Timeout reached while waiting for %s to become %s',
                      node['name'], state)
            return False
        node = get_vm_status(vmid=vmid)
        log.debug('State for %s is: "%s" instead of "%s"',
                  node['name'], node['status'], state)
1086518
def wait(self, timeout=None):
        

        if timeout is not None:
            if not self._thread:
                self._thread = threading.Thread(target=self._wait4process)
                self._thread.daemon = 1
                self._thread.start()

        if self._thread:
            self._thread.join(timeout=timeout)
            self.timeout_happened = self.timeout_happened or self._thread.isAlive()
        else:
            # no timeout and no existing thread
            self._wait4process()

        return self
252126
async def _perform_ping_timeout(self, delay: int):
        

        # pause for delay seconds
        await sleep(delay)
        # then continue
        error = TimeoutError(
            'Ping timeout: no data received from server in {timeout} seconds.'.format(
                timeout=self.PING_TIMEOUT))
        await self.on_data_error(error)
1352003
def wait_for(self,
               condition,
               interval = DEFAULT_WAIT_INTERVAL,
               timeout  = DEFAULT_WAIT_TIMEOUT):
    

    start = time.time()

    # at least execute the check once!
    while True:
      res = condition()
      if res:
        return res

      # timeout?
      if time.time() - start > timeout:
        break

      # wait a bit
      time.sleep(interval)

    # timeout occured!
    raise WaitTimeoutError("wait_for timed out")
925962
def wait(self, state, timeout=-1):
        

        if isinstance(state, str):
            state = state.upper()

        return _lxc.Container.wait(self, state, timeout)
845110
def wait_for_connection(self, timeout=None):
        
        if timeout is not None:
            wait_time = timeout / 10.0
        else:
            wait_time = None
        with self.__connect_wait_condition:
            while self.running and not self.is_connected() and not self.connection_error:
                self.__connect_wait_condition.wait(wait_time)
        if not self.running or not self.is_connected():
            raise exception.ConnectFailedException()
681951
def do_timeout(self, args):
        

        if not self.current:
            print('There are no resources in use. Use the command "open".')
            return

        args = args.strip()

        if not args:
            try:
                print('Timeout: {}ms'.format(self.current.timeout))
            except Exception as e:
                print(e)
        else:        
            args = args.split(' ')
            try:
                self.current.timeout = float(args[0])
                print('Done')
            except Exception as e:
                print(e)
1315129
def is_ready_for_command(self, timeout=0):
        
        while True:
            try:
                return self.check_is_ready_for_command(timeout)
            except (select.error, IOError) as ex:
                if self.errno_from_exception(ex) == errno.EINTR:
                    continue
                return False
40003
def wait_until_online(function, ip, port):
    
    awaiting_service = Wait_For_State(lambda: not is_port_available(ip, port), function)
    awaiting_service.start()
    return awaiting_service
1077866
def wait_for_states(self, timeout=40, *states):
        

        state = self.get_attribute('state')
        for _ in range(timeout):
            if state in states:
                return
            time.sleep(1)
            state = self.get_attribute('state')
        raise TgnError('Failed to reach states {}, port state is {} after {} seconds'.format(states, state, timeout))
165252
def wait_for_start(self):
        
        er = self.exec_rabbitmqctl(
            'wait', ['--pid', '1', '--timeout', str(int(self.wait_timeout))])
        output_lines(er, error_exc=TimeoutError)