Skip to content
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

[Serve] Remove Ray Cluster dependency in test_deployment_state #39952

Merged
merged 4 commits into from
Sep 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions python/ray/serve/tests/test_deployment_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
ReplicaStateContainer,
VersionedReplica,
)
from ray.serve._private.storage.kv_store import RayInternalKVStore
from ray.serve._private.utils import get_random_letters
from ray.serve.tests.utils import MockKVStore, MockTimer

Expand Down Expand Up @@ -2468,7 +2467,7 @@ def mock_deployment_state_manager(request) -> Tuple[DeploymentStateManager, Mock
), patch(
"ray.serve._private.long_poll.LongPollHost"
) as mock_long_poll:
kv_store = RayInternalKVStore("test")
kv_store = MockKVStore()
cluster_node_info_cache = MockClusterNodeInfoCache()
mock_create_deployment_scheduler.return_value = MockDeploymentScheduler(
cluster_node_info_cache
Expand Down Expand Up @@ -2578,19 +2577,6 @@ def test_default_value(self):
assert actor_replica.health_check_period_s == DEFAULT_HEALTH_CHECK_PERIOD_S
assert actor_replica.health_check_timeout_s == DEFAULT_HEALTH_CHECK_TIMEOUT_S

def test_recover(self):
actor_replica = ActorReplicaWrapper(
version=deployment_version("1"),
actor_name="test",
controller_name="test_controller",
replica_tag="test_tag",
deployment_id=DeploymentID("test_deployment", "test_app"),
)
actor_replica._actor_handle = MockActorHandle()
actor_replica.recover()
assert actor_replica._actor_handle.initialize_and_get_metadata_called
assert actor_replica._actor_handle.is_allocated_called


def test_get_active_node_ids(mock_deployment_state_manager_full):
"""Test get_active_node_ids() are collecting the correct node ids
Expand Down
Loading