code: def wait_for_startup(self, timeout=None):
          
          if not self.is_starting():
              # Should not happen
              logger.warning("wait_for_startup() called when not in starting state")
  
          while not self.check_startup_state_changed():
              with self._cancellable_lock:
                  if self._is_cancelled:
                      return None
              if timeout and self.time_in_state() > timeout:
                  return None
              time.sleep(1)
  
          return self.state == 'running'
docs: Waits for PostgreSQL startup to complete or fail.
  
          :returns: True if start was successful, False otherwise