python/ray/tests/kuberay/utils.py
def wait_for_pods(goal_num_pods: int, namespace: str, tries=60, backoff_s=5) -> None:
    """Wait for the number of pods in the `namespace` to be exactly `num_pods`.

    Raise an exception after exceeding `tries` attempts with `backoff_s` second waits.
    """
    for i in range(tries):

        cur_num_pods = _get_num_pods(namespace)
        if cur_num_pods == goal_num_pods:
            logger.info(f"Confirmed {goal_num_pods} pod(s) in namespace {namespace}.")
            return
        elif i < tries - 1:
            logger.info(
                f"The number of pods in namespace {namespace} is {cur_num_pods}."
                f" Waiting until the number of pods is {goal_num_pods}."
            )
            time.sleep(backoff_s)
        else:
            raise Exception(
                f"Failed to scale to {goal_num_pods} pod(s) in namespace {namespace}."
            )
Wait for the number of pods in the `namespace` to be exactly `num_pods`.

    Raise an exception after exceeding `tries` attempts with `backoff_s` second waits.
    
Wait for the number of pods in the `namespace` to be exactly `num_pods`.
Raise an exception after exceeding `tries` attempts with `backoff_s` second waits.
Wait for the number of pods in the ` namespace ` to be exactly ` num_pods ` . Raise an exception after exceeding ` tries ` attempts with ` backoff_s ` second waits .
def wait_for_pods(goal_num_pods: int, namespace: str, tries=60, backoff_s=5) -> None:
    for i in range(tries):
        cur_num_pods = _get_num_pods(namespace)
        if cur_num_pods == goal_num_pods:
            logger.info(f"Confirmed {goal_num_pods} pod(s) in namespace {namespace}.")
            return
        elif i < tries - 1:
            logger.info(
                f"The number of pods in namespace {namespace} is {cur_num_pods}."
                f" Waiting until the number of pods is {goal_num_pods}."
            )
            time.sleep(backoff_s)
        else:
            raise Exception(
                f"Failed to scale to {goal_num_pods} pod(s) in namespace {namespace}."
            )
def wait_for_pods ( goal_num_pods : int , namespace : str , tries = 60 , backoff_s = 5 ) -> None : for i in range ( tries ) : cur_num_pods = _get_num_pods ( namespace ) if cur_num_pods == goal_num_pods : logger . info ( f"Confirmed {goal_num_pods} pod(s) in namespace {namespace}." ) return elif i < tries - 1 : logger . info ( f"The number of pods in namespace {namespace} is {cur_num_pods}." f" Waiting until the number of pods is {goal_num_pods}." ) time . sleep ( backoff_s ) else : raise Exception ( f"Failed to scale to {goal_num_pods} pod(s) in namespace {namespace}." )
Wait for the number of pods in the `namespace` to be exactly `num_pods`.
Wait for the number of pods in the ` namespace ` to be exactly ` num_pods ` .
"""Wait for the number of pods in the `namespace` to be exactly `num_pods`.

    Raise an exception after exceeding `tries` attempts with `backoff_s` second waits.
    """
goal_num_pods
int
namespace
str
tries
backoff_s