Skip to content

[serve] move test from test_grpc to test_proxy #53933

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zcin
Copy link
Contributor

@zcin zcin commented Jun 18, 2025

Why are these changes needed?

Move serve test to a different file.

Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
@Copilot Copilot AI review requested due to automatic review settings June 18, 2025 20:49
@zcin zcin requested a review from a team as a code owner June 18, 2025 20:49
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR reorganizes gRPC proxy tests by moving the draining-node scenario into test_proxy.py and cleaning up/renaming related tests in test_grpc.py.

  • Adds a new test_grpc_proxy_on_draining_nodes in test_proxy.py to cover draining behavior.
  • Removes the same test from test_grpc.py and renames existing gRPC test functions to drop “proxy” suffix.
  • Cleans up imports in test_grpc.py to reflect the moved test and updated names.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
python/ray/serve/tests/test_proxy.py Adds test_grpc_proxy_on_draining_nodes with supporting imports and logic.
python/ray/serve/tests/test_grpc.py Deletes the moved test, renames functions (dropping “proxy”), and updates imports.
Comments suppressed due to low confidence (1)

python/ray/serve/tests/test_grpc.py:121

  • [nitpick] The docstring still refers to the 'gRPC proxy' after renaming the test; update it to match the new function name (test_grpc_routing_without_metadata) for consistency.
    """Test metadata are not required when calling gRPC proxy with only one app.


# Setup worker gRPC proxy to be pointing to port 9001. Head node gRPC proxy will
# continue to be pointing to the default port 9000.
os.environ["TEST_WORKER_NODE_GRPC_PORT"] = str(worker_node_grpc_port)
Copy link
Preview

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using pytest's monkeypatch.setenv to set this environment variable and ensure it’s automatically restored after the test, avoiding side effects on other tests.

Suggested change
os.environ["TEST_WORKER_NODE_GRPC_PORT"] = str(worker_node_grpc_port)
monkeypatch.setenv("TEST_WORKER_NODE_GRPC_PORT", str(worker_node_grpc_port))

Copilot uses AI. Check for mistakes.

@@ -89,5 +99,134 @@ def test_set_timeout_keep_alive_in_both_config_and_env(
)


def test_grpc_proxy_on_draining_nodes(ray_cluster):
Copy link
Preview

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ray_cluster fixture is not used inside the test body; removing it from the signature will prevent confusion about unused fixtures.

Suggested change
def test_grpc_proxy_on_draining_nodes(ray_cluster):
def test_grpc_proxy_on_draining_nodes():

Copilot uses AI. Check for mistakes.

@zcin zcin added the go add ONLY when ready to merge, run all tests label Jun 19, 2025
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.

1 participant