Skip to content

[cherry-pick][2.60.0][serve] Deflake test_deploy_app_3 (#67165) - #67438

Merged
elliot-barn merged 1 commit into
ray-project:cherrypick/2.60.0-pr66492from
qishengxhe:cherrypick/2.60.0-pr67165
Oct 26, 2026
Merged

elliot-barn merged 1 commit into
ray-project:cherrypick/2.60.0-pr66492from
qishengxhe:cherrypick/2.60.0-pr67165

Conversation

@qishengxhe

@qishengxhe qishengxhe commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Cherry-pick of #67165 ([serve] Deflake test_deploy_app_3) onto releases/2.60.0. Master commit b2ca380473.

Applied cleanly with git cherry-pick -x. Test-only change: test_deploy_app_3.py.

Depends on #67439 (cherry-pick of #66492), which adds the INGRESS_DRAIN_ENV fixture constant this test imports. Stacked on that PR so this diff shows only #67165; merge #67439 first, then retarget this PR to releases/2.60.0.

No other backport PR for this change targets releases/2.60.0. pre-commit run --files on the touched file passes. Relying on CI for the test runs.

AI assistance was used to prepare this cherry-pick.

…7165)

`test_deploy_app_3` (added in ray-project#66267) flakes on the HAProxy, gRPC and
flaky-tests shards. One commit per cause:

- Two waits read replica counts and pids in separate calls, so a replica
changing state in between could pass for the state they wait for. They
now read one snapshot, as ray-project#67163 does for the same race in
`test_deploy_app_2`.
- The HAProxy shard's 0.01s drain lets a stopping replica close
connections HAProxy still uses. The traffic tests whose replicas stop
during a rollout now use the 5s drain `test_deploy_app_2` already uses;
the gang test is left out, since gang replicas are force-stopped.
- Under direct ingress, a request moving from the handle to a replica
can briefly count twice, which raised the autoscaling target in
`test_surge_rolling_update_follows_autoscaling_mid_rollout`. A 2s
upscale delay filters it.
- Two waits that ran close to their limit under load get more room.

Tested with `pytest python/ray/serve/tests/test_deploy_app_3.py` under
the default and HAProxy shard environments with CPU stressors: 13 of 13
in each at the final commit.

---------

Signed-off-by: john.taylor <[email protected]>
Co-authored-by: Claude <[email protected]>
(cherry picked from commit b2ca380)
Signed-off-by: qishengxhe <[email protected]>
@qishengxhe qishengxhe added the go add ONLY when ready to merge, run all tests label Oct 26, 2026
@qishengxhe
qishengxhe marked this pull request as ready for review October 26, 2026 20:02
@qishengxhe
qishengxhe requested a review from a team as a code owner October 26, 2026 20:02

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 optimizes and stabilizes Ray Serve integration tests, particularly on Windows. Key changes include isolating the long-running test_deploy_app_2.py into its own Bazel target with an eternal timeout, extracting shared test environments, and introducing INGRESS_DRAIN_ENV to ensure stopping replicas outlast HAProxy reloads during rolling updates. Additionally, test robustness is improved by adding explicit timeouts to wait_for_condition calls, utilizing single-snapshot reads to prevent race conditions in assertions, and adjusting autoscaling delays. There are no review comments provided, so I have no additional feedback to offer.

@qishengxhe
qishengxhe changed the base branch from releases/2.60.0 to cherrypick/2.60.0-pr66492 October 26, 2026 20:10
elliot-barn pushed a commit that referenced this pull request Oct 26, 2026
…, a longer ingress drain for the traffic tests, and a Windows timeout (#66492) (#67439)

Cherry-pick of #66492 ([serve] Deflake test_deploy_app_2 - wait budgets,
a longer ingress drain for the traffic tests, and a Windows timeout)
onto `releases/2.60.0`. Master commit `09cc6ec807`.

Applied cleanly with `git cherry-pick -x`. Test-only changes:
`BUILD.bazel`, `test_config_files/fail_on_flag.py`,
`test_deploy_app_2.py`.

Needed on the release branch because #67165 (cherry-pick in #67438)
imports `INGRESS_DRAIN_ENV`, which this change adds. Split into its own
PR so each squash on the release branch maps to one master commit.

No other backport PR for this change targets `releases/2.60.0`.
`pre-commit run --files` on the touched files passes. Relying on CI for
the test runs.

AI assistance was used to prepare this cherry-pick.

Signed-off-by: qishengxhe <[email protected]>
Co-authored-by: johntaylor-cell <[email protected]>
@elliot-barn
elliot-barn merged commit c4840ed into ray-project:cherrypick/2.60.0-pr66492 Oct 26, 2026
5 of 7 checks passed
elliot-barn added a commit that referenced this pull request Oct 26, 2026
Cherry-pick of #67165 onto `releases/2.60.0`.

Original PR: #67165 (merged on master as b2ca380). This cherry-pick
was first made as #67438. That PR was stacked on the #66492 cherry-pick
branch and merged into it after #67439 had already landed, so it never
reached `releases/2.60.0`. This PR applies the same commit (c4840ed)
directly onto `releases/2.60.0`. It replaces #67441, which was opened
from the stacked branch and showed the already-landed #66492 changes
alongside this one.

## Change

`python/ray/serve/tests/test_deploy_app_3.py` only, +59/-41, identical
to #67165 and #67438. The cherry-pick applied cleanly.

From #67165: `test_deploy_app_3` flakes on the HAProxy, gRPC and
flaky-tests shards. The fix:
- waits read replica counts and pids from one snapshot;
- traffic tests whose replicas stop during a rollout use the 5s HAProxy
drain;
- handles the direct-ingress request-count race.

## Testing

Test-only change, verified on master in #67165. This PR's premerge runs
the Serve test shards against `releases/2.60.0`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: john.taylor <[email protected]>
Signed-off-by: qishengxhe <[email protected]>
Co-authored-by: qishengxhe <[email protected]>
Co-authored-by: johntaylor-cell <[email protected]>
Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants