-
Notifications
You must be signed in to change notification settings - Fork 7k
add deployment status check in test #58087
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: abrar <abrar@anyscale.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request improves test stability by adding checks to wait for deployments to become healthy before proceeding with the tests. This is a good practice to avoid flakiness. My review includes suggestions to consolidate the health checks for multiple deployments into a single, more efficient call to improve code readability and performance.
| wait_for_condition( | ||
| check_deployment_status, name="A", expected_status=DeploymentStatus.HEALTHY | ||
| ) | ||
| wait_for_condition( | ||
| check_deployment_status, name="B", expected_status=DeploymentStatus.HEALTHY | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For improved readability and efficiency, you can combine the health checks for multiple deployments into a single wait_for_condition call. This avoids the overhead of multiple wait_for_condition calls and can be more efficient by fetching the status of all deployments at once.
A helper function could be defined for this. For example:
def check_deployments_healthy(names: List[str], app_name: str = SERVE_DEFAULT_APP_NAME):
statuses = serve.status().applications[app_name].deployments
return all(
statuses.get(name) and statuses[name].status == DeploymentStatus.HEALTHY
for name in names
)And then call it like this:
wait_for_condition(check_deployments_healthy, names=["A", "B"])This helper could be defined locally within the test method or, if it's generally useful, in ray.serve._private.test_utils.
| wait_for_condition( | ||
| check_deployment_status, name="A", expected_status=DeploymentStatus.HEALTHY | ||
| ) | ||
| wait_for_condition( | ||
| check_deployment_status, name="B", expected_status=DeploymentStatus.HEALTHY | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't |
is app running imply deployment == healthy ? I am 90% sure that is true. but also |
so is it redundant then? |
I suspect that when we deploy the app config, we dont wait long enough before sending traffic, so requests could go to the wrong version --------- Signed-off-by: abrar <abrar@anyscale.com> Signed-off-by: xgui <xgui@anyscale.com>
I suspect that when we deploy the app config, we dont wait long enough before sending traffic, so requests could go to the wrong version --------- Signed-off-by: abrar <abrar@anyscale.com>
I suspect that when we deploy the app config, we dont wait long enough before sending traffic, so requests could go to the wrong version --------- Signed-off-by: abrar <abrar@anyscale.com> Signed-off-by: Aydin Abiar <aydin@anyscale.com>
I suspect that when we deploy the app config, we dont wait long enough before sending traffic, so requests could go to the wrong version --------- Signed-off-by: abrar <abrar@anyscale.com> Signed-off-by: Future-Outlier <eric901201@gmail.com>
I suspect that when we deploy the app config, we dont wait long enough before sending traffic, so requests could go to the wrong version