[serve] Ensure deployment converges to healthy state#61818
Merged
Conversation
Signed-off-by: Jeffrey Wang <jeffreywang@anyscale.com>
abrarsheikh
approved these changes
Mar 18, 2026
Contributor
There was a problem hiding this comment.
Code Review
This pull request addresses a flaky test by ensuring deployments reach a healthy state within a wait_for_condition loop, which is a robust way to handle race conditions in tests. The implementation correctly moves the status check into the waiting logic. I have one minor suggestion to improve the conciseness of the new code.
Comment on lines
+366
to
+368
| for dep_status in app_status.deployments.values(): | ||
| if dep_status.status != DeploymentStatus.HEALTHY: | ||
| return False |
Contributor
There was a problem hiding this comment.
For conciseness, you can use any() with a generator expression to check for any unhealthy deployments. This can make the intent slightly clearer.
Suggested change
| for dep_status in app_status.deployments.values(): | |
| if dep_status.status != DeploymentStatus.HEALTHY: | |
| return False | |
| if any( | |
| dep_status.status != DeploymentStatus.HEALTHY | |
| for dep_status in app_status.deployments.values() | |
| ): | |
| return False |
ryanaoleary
pushed a commit
to ryanaoleary/ray
that referenced
this pull request
Mar 25, 2026
## Description Deployments can be in `DEPLOYING` status while serving traffic, breaking the existing assertion that the deployment must be in healthy state. Instead, we check whether the deployment reaches a healthy state in `wait_for_condition` to avoid such race situation. ## Related issues Fixed postmerge flaky test: https://buildkite.com/ray-project/postmerge/builds/16498#019cfcac-67e1-4235-91ef-e1e3eb8450b3/L1058. ## Additional information > Optional: Add implementation details, API changes, usage examples, screenshots, etc. Signed-off-by: Jeffrey Wang <jeffreywang@anyscale.com>
Lucas61000
pushed a commit
to Lucas61000/ray
that referenced
this pull request
May 15, 2026
## Description Deployments can be in `DEPLOYING` status while serving traffic, breaking the existing assertion that the deployment must be in healthy state. Instead, we check whether the deployment reaches a healthy state in `wait_for_condition` to avoid such race situation. ## Related issues Fixed postmerge flaky test: https://buildkite.com/ray-project/postmerge/builds/16498#019cfcac-67e1-4235-91ef-e1e3eb8450b3/L1058. ## Additional information > Optional: Add implementation details, API changes, usage examples, screenshots, etc. Signed-off-by: Jeffrey Wang <jeffreywang@anyscale.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Deployments can be in
DEPLOYINGstatus while serving traffic, breaking the existing assertion that the deployment must be in healthy state. Instead, we check whether the deployment reaches a healthy state inwait_for_conditionto avoid such race situation.Related issues
Fixed postmerge flaky test: https://buildkite.com/ray-project/postmerge/builds/16498#019cfcac-67e1-4235-91ef-e1e3eb8450b3/L1058.
Additional information