Repository navigation
[serve] Deflake test_direct_ingress by moving the test gRPC port range below the ephemeral range - #66940
Merged
abrarsheikh merged 3 commits intoOct 14, 2026
Conversation
…e below the ephemeral range The default direct-ingress gRPC range (40000-41000) sits inside the kernel ephemeral range (32768-60999), where every Ray worker binds its listen port. When a worker takes one of the ports the tests expect free, the all-ports-bindable wait never passes and every following port test fails. Pin the test targets to 31500-32500 and derive expected gRPC ports from it. Co-Authored-By: Claude <[email protected]> Signed-off-by: john.taylor <[email protected]>
Contributor
There was a problem hiding this comment.
Code Review
This pull request configures a specific gRPC port range (31500 to 32500) for the direct ingress tests in python/ray/serve/tests/BUILD.bazel to prevent port conflicts with Ray workers, which use the kernel ephemeral range (32768+). In test_direct_ingress.py, hardcoded gRPC ports (previously starting at 40000) are replaced with dynamically calculated ports relative to the configured minimum port using a new helper function _expected_grpc_ports. There are no review comments, so no feedback is provided.
abrarsheikh
reviewed
Oct 13, 2026
…emeral range Production replicas share the same exposure the tests had: 40000-41000 sits inside the Linux ephemeral range, so any Ray worker on the node can already hold one of those ports. Default the gRPC range to 31500-32500 and drop the test-only BUILD pin, which is now redundant. Co-Authored-By: Claude <[email protected]> Signed-off-by: john.taylor <[email protected]>
abrarsheikh
reviewed
Oct 14, 2026
…TTP checks Co-Authored-By: Claude <[email protected]> Signed-off-by: john.taylor <[email protected]>
abrarsheikh
approved these changes
Oct 14, 2026
sai-miduthuri
pushed a commit
that referenced
this pull request
Oct 16, 2026
…rcent` for start-before-stop rolling updates (#66267) (#67094) Cherry-pick of #66267 (master commit 9491664) onto `releases/2.60.0`. ## Why The first three PRs of the in-place-updates series (#66252, #66290, #66266) are already on `releases/2.60.0`. This picks the fourth, which adds `max_surge_percent` for start-before-stop rolling updates, so 2.60.0 ships the complete series. ## Cherry-pick details `git cherry-pick -x` conflicted in one file, `python/ray/serve/tests/unit/test_deployment_state.py`. The conflict was positional only: on master, #66243 (push-based replica health) had appended `TestPushedHealthEndToEnd` and related tests to the end of that file, and #66267 inserts `TestMaxSurge` right before them. This branch doesn't have #66243, so git couldn't anchor the hunk and offered the #66243 tests as part of the incoming side. Resolved by inserting only the PR's `TestMaxSurge` block (plus its `defaultdict` import) before the `__main__` guard. The added and removed lines in each of the 17 files are identical to the master commit's diff. After the pick, 11 of the 17 files are byte-identical to master at 9491664. The other 6 differ only by master commits that aren't on this branch and that #66267 doesn't depend on: - `_private/deployment_state.py`, `tests/unit/test_deployment_state.py`: #66243. - `schema.py`, `tests/BUILD.bazel`, `tests/test_controller.py`, `tests/test_direct_ingress.py`: #66339 and #66940. No commit on `releases/2.60.0` after the branch cut touched any of these files. Not a duplicate: no PR against `releases/2.60.0` references #66267. ## Testing Run on this branch with the Serve protobuf regenerated from the branch's `serve.proto` (the pick adds the `max_surge_percent` field). ``` python -m pytest python/ray/serve/tests/unit/test_deployment_state.py python/ray/serve/tests/unit/test_config.py python/ray/serve/tests/unit/test_deployment_class.py python/ray/serve/tests/unit/test_schema.py 3530 passed, 12 skipped ``` ``` python -m pytest python/ray/serve/tests/test_deploy_app_3.py python/ray/serve/tests/test_deploy_app_2.py -k surge 13 passed, 41 deselected in 282s ``` `pre-commit run --files <changed files>` passed. AI assistance was used to prepare this cherry-pick. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Qisheng He <[email protected]> Signed-off-by: qishengxhe <[email protected]>
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.
The default direct ingress gRPC range (40000-41000) sits inside the Linux ephemeral port range (32768-60999), where every Ray worker binds its listen port. When a worker takes a port the tests expect free,
test_replica_releases_ports_on_shutdownexhausts its "all ports bindable" wait and every later port test fails with it. HTTP (30000-31000) is below the ephemeral range and unaffected.This pins the gRPC range for both test targets to 31500-32500 via a shared BUILD env and derives the expected gRPC ports from
RAY_SERVE_DIRECT_INGRESS_MIN_GRPC_PORTinstead of hardcoding4000N.