checks to see if the server_core is running

        args:
            delay: will cycle till core is up.
            timeout: number of seconds to wait
11919
def verify_server_core(timeout=120, start_delay=90):
    ''' 
    '''
    timestamp = time.time()
    last_check = time.time() + start_delay - 10
    last_delay_notification = time.time() - 10
    server_down = True
    return_val = False
    timeout += 1
    # loop until the server is up or the timeout is reached
    while((time.time()-timestamp) < timeout) and server_down:
        # if delaying, the start of the check, print waiting to start
        if start_delay > 0 and time.time() - timestamp < start_delay \
                and (time.time()-last_delay_notification) > 5:
            print("Delaying server status check until %ss. Current time: %ss" \
                    % (start_delay, int(time.time() - timestamp)))
            last_delay_notification = time.time()
        # send a request check every 10s until the server is up
        while ((time.time()-last_check) > 10) and server_down:
            print("Checking status of servers at %ss" % \
                    int((time.time()-timestamp)))
            last_check = time.time()
            try:
                repo = requests.get(CFG.REPOSITORY_URL)
                repo_code = repo.status_code
                print ("\t", CFG.REPOSITORY_URL, " - ", repo_code)
            except:
                repo_code = 400
                print ("\t", CFG.REPOSITORY_URL, " - DOWN")
            try:
                triple = requests.get(CFG.DATA_TRIPLESTORE.url)
                triple_code = triple.status_code
                print ("\t", CFG.DATA_TRIPLESTORE.url, " - ", triple_code)
            except:
                triple_code = 400
                print ("\t", CFG.DATA_TRIPLESTORE.url, " - down")
            if repo_code == 200 and triple_code == 200:
                server_down = False
                return_val = True
                print("**** Servers up at %ss" % \
                    int((time.time()-timestamp)))
                break
    return return_val
992384
def wait(self, timeout=None):
        
        timeout = ["--interval=%s" % timeout] if timeout else []
        cmdline = ["podman", "wait"] + timeout + [self._id or self.get_id()]
        return run_cmd(cmdline, return_output=True)
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)
24489
def ensure_started(self):
        
        # server is either starting or stopping (or error)
        if self.state in ['maintenance', 'error']:
            self._wait_for_state_change(['stopped', 'started'])

        if self.state == 'stopped':
            self.start()
            self._wait_for_state_change(['started'])

        if self.state == 'started':
            return True
        else:
            # something went wrong, fail explicitly
            raise Exception('unknown server state: ' + self.state)
1140405
def timeout(self, seconds=None):
        
        if seconds is None:
            self.socketIO.wait()
        else:
            self.socketIO.wait(seconds=seconds)
1140974
def wait(self, timeout=0):
        
        start_time = time.time()

        # We return synchronously, so we block in a busy loop waiting for the
        # request to be done.
        while not self.is_done:
            duration = time.time() - start_time
            if timeout and duration > timeout:
                raise CloudTimeoutError(
                    "Timeout getting async value. Timeout: %d seconds" % timeout
                )
            time.sleep(0.1)

        # If we get an any status code other than a 2xx we raise an exception to the user, which can then be handled
        # accordingly.
        status_code, error_msg, payload = self.check_error()
        if not self._status_ok(status_code):
            raise CloudAsyncError("Async response for '%s' returned an error." % self.async_id,
                                  reason=error_msg,
                                  status=status_code)

        value = self.value
        if isinstance(value, six.binary_type):
            value = value.decode('utf-8')
        return value
396793
def monitor(self, timeout):
        

        def check(self, timeout):
            time.sleep(timeout)
            self.stop()
        wather = threading.Thread(target=check)
        wather.setDaemon(True)
        wather.start()
58709
def _check_timeout(start_time, timeout):
    '''
    
    '''
    timeout_milisec = timeout * 60000
    if timeout_milisec < (int(round(time.time() * 1000)) - start_time):
        raise salt.exceptions.TimeoutError('Timeout expired.')
622045
def wait_while_reachable(self, servers, timeout=60):
        
        t_start = time.time()
        while True:
            try:
                for server in servers:
                    # TODO: use state code to check if server is reachable
                    server_info = self.connection(
                        hostname=server, timeout=5).admin.command('ismaster')
                    logger.debug("server_info: {server_info}".format(server_info=server_info))
                    if int(server_info['ok']) != 1:
                        raise pymongo.errors.OperationFailure("{server} is not reachable".format(**locals))
                return True
            except (KeyError, AttributeError, pymongo.errors.AutoReconnect, pymongo.errors.OperationFailure):
                if time.time() - t_start > timeout:
                    return False
                time.sleep(0.1)
1297943
def wait(self, timeout=None):
    

    t_start = time.clock()
    if not wait_for_condition(self, lambda s: s._tasks == 0, timeout):
      raise Timeout
670101
def _wait_for_completion(conn, wait_timeout, server_id):
    '''
    
    '''
    wait_timeout = time.time() + wait_timeout
    while wait_timeout > time.time():
        time.sleep(5)

        server = conn.get_server(server_id)
        server_state = server['status']['state'].lower()

        if server_state == "powered_on":
            return
        elif server_state == 'failed':
            raise Exception('Server creation failed for {0}'.format(server_id))
        elif server_state in ('active',
                              'enabled',
                              'deploying',
                              'configuring'):
            continue
        else:
            raise Exception(
                'Unknown server state {0}'.format(server_state))
    raise Exception(
        'Timed out waiting for server create completion for {0}'.format(server_id)
    )
1081383
def isRunning(self, waitTime=0):
        
        waitUntil = time.time() + waitTime
        while True:
            if self.getPID() > 0:
                return True
            else:
                self._pid = PlatformManager.getWindowPID(PlatformManager.getWindowByTitle(re.escape(self._title)))

            # Check if we've waited long enough
            if time.time() > waitUntil:
                break
            else:
                time.sleep(self._defaultScanRate)
        return self.getPID() > 0
699778
def wait(self, timeout=-1):
        
        if self._process is None:
            raise RuntimeError('no child process')
        if timeout == -1:
            timeout = self._timeout
        if not self._child_exited.wait(timeout):
            raise Timeout('timeout waiting for child to exit')
        return self.returncode
1020850
def wait_for_running(self):
        """"""
        self.server_attrs = self.consul.find_running(
                self.server_attrs,
                self.launch_timeout_s,
                )
1232106
def wait_gone(self, timeout=None, raise_error=True):
        
        start_time = time.time()
        if timeout is None or timeout <= 0:
            timeout = self.timeout
        while start_time + timeout > time.time():
            if not self.exists:
                return True
        if not raise_error:
            return False
        raise WDAElementNotDisappearError("element not gone")
399309
public boolean waitForActive(long timeout)
  {
    LifecycleState state = getState();

    if (state.isActive()) {
      return true;
    }
    else if (state.isAfterActive()) {
      return false;
    }
    
    // server/1d2j
    long waitEnd = CurrentTime.getCurrentTimeActual() + timeout;

    synchronized (this) {
      while ((state = _state).isBeforeActive()
             && CurrentTime.getCurrentTimeActual() < waitEnd) {
        if (state.isActive()) {
          return true;
        }
        else if (state.isAfterActive()) {
          return false;
        }

        try {
          long delta = waitEnd - CurrentTime.getCurrentTimeActual();
          
          if (delta > 0) {
            wait(delta);
          }
        } catch (InterruptedException e) {
        }
      }
    }
    
    return _state.isActive();
  }
547134
def wait(self, timeout=None):
        
        import threading

        if self._state!=self.PENDING:
            return

        e = threading.Event()
        self.addCallback(lambda v: e.set())
        self.addErrback(lambda r: e.set())
        e.wait(timeout)