Skip to content

Commit

Permalink
[Serve] Fix dashboard test (ray-project#34758)
Browse files Browse the repository at this point in the history
Fixes test_serve_agent.

Signed-off-by: sihanwang41 <[email protected]>
  • Loading branch information
sihanwang41 committed Apr 26, 2023
1 parent c4a29b2 commit 8526932
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions dashboard/modules/serve/tests/test_serve_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
from ray.serve.tests.conftest import * # noqa: F401 F403
from ray.serve.schema import ServeInstanceDetails
from ray.serve._private.common import ApplicationStatus, DeploymentStatus, ReplicaState
from ray.serve._private.constants import (
SERVE_DEFAULT_APP_NAME,
DEPLOYMENT_NAME_PREFIX_SEPARATOR,
)

GET_OR_PUT_URL = "http:https://localhost:52365/api/serve/deployments/"
STATUS_URL = "http:https://localhost:52365/api/serve/deployments/status"
Expand Down Expand Up @@ -444,7 +448,10 @@ def test_get_status(ray_start_stop):

deployment_statuses = serve_status["deployment_statuses"]
assert len(deployment_statuses) == 2
expected_deployment_names = {"f", "BasicDriver"}
expected_deployment_names = {
f"{SERVE_DEFAULT_APP_NAME}{DEPLOYMENT_NAME_PREFIX_SEPARATOR}f",
f"{SERVE_DEFAULT_APP_NAME}{DEPLOYMENT_NAME_PREFIX_SEPARATOR}BasicDriver",
}
for deployment_status in deployment_statuses:
assert deployment_status["name"] in expected_deployment_names
expected_deployment_names.remove(deployment_status["name"])
Expand Down Expand Up @@ -705,7 +712,10 @@ def test_serve_namespace(ray_start_stop):
serve_status = client.get_serve_status()
assert (
len(serve_status.deployment_statuses) == 2
and serve_status.get_deployment_status("f") is not None
and serve_status.get_deployment_status(
f"{SERVE_DEFAULT_APP_NAME}{DEPLOYMENT_NAME_PREFIX_SEPARATOR}f"
)
is not None
)
print("Successfully retrieved deployment statuses with Python API.")
print("Shutting down Python API.")
Expand Down

0 comments on commit 8526932

Please sign in to comment.