python/ray/serve/tests/test_application.py
def deploy_and_check_responses(
        self, deployments, responses, blocking=True, client=None
    ):
        """
        Helper function that deploys the list of deployments, calls them with
        their handles, and checks whether they return the objects in responses.
        If blocking is False, this function uses a non-blocking deploy and uses
        the client to wait until the deployments finish deploying.
        """

        serve.run(Application(deployments), _blocking=blocking)

        def check_all_deployed():
            try:
                for deployment, response in zip(deployments, responses):
                    if ray.get(deployment.get_handle().remote()) != response:
                        return False
            except Exception:
                return False

            return True

        if blocking:
            # If blocking, this should be guaranteed to pass immediately.
            assert check_all_deployed()
        else:
            # If non-blocking, this should pass eventually.
            wait_for_condition(check_all_deployed)

        Helper function that deploys the list of deployments, calls them with
        their handles, and checks whether they return the objects in responses.
        If blocking is False, this function uses a non-blocking deploy and uses
        the client to wait until the deployments finish deploying.
        
Helper function that deploys the list of deployments, calls them with
their handles, and checks whether they return the objects in responses.
If blocking is False, this function uses a non-blocking deploy and uses
the client to wait until the deployments finish deploying.
Helper function that deploys the list of deployments calls them with their handles and checks whether they return the objects in responses . If blocking is False this function uses a non - blocking deploy and uses the client to wait until the deployments finish deploying .
def deploy_and_check_responses(
        self, deployments, responses, blocking=True, client=None
    ):
        serve.run(Application(deployments), _blocking=blocking)
        def check_all_deployed():
            try:
                for deployment, response in zip(deployments, responses):
                    if ray.get(deployment.get_handle().remote()) != response:
                        return False
            except Exception:
                return False
            return True
        if blocking:
            assert check_all_deployed()
        else:
            wait_for_condition(check_all_deployed)
def deploy_and_check_responses ( self , deployments , responses , blocking = True , client = None ) : serve . run ( Application ( deployments ) , _blocking = blocking ) def check_all_deployed ( ) : try : for deployment , response in zip ( deployments , responses ) : if ray . get ( deployment . get_handle ( ) . remote ( ) ) != response : return False except Exception : return False return True if blocking : assert check_all_deployed ( ) else : wait_for_condition ( check_all_deployed )
Helper function that deploys the list of deployments, calls them with
their handles, and checks whether they return the objects in responses.
Helper function that deploys the list of deployments calls them with their handles and checks whether they return the objects in responses .
"""
        Helper function that deploys the list of deployments, calls them with
        their handles, and checks whether they return the objects in responses.
        If blocking is False, this function uses a non-blocking deploy and uses
        the client to wait until the deployments finish deploying.
        """ # If blocking, this should be guaranteed to pass immediately. # If non-blocking, this should pass eventually.
self
deployments
responses
blocking
client