From 17080813a374dd4b69911948f48de1386126b299 Mon Sep 17 00:00:00 2001 From: Sihan Wang Date: Thu, 28 Sep 2023 12:42:01 -0700 Subject: [PATCH 1/3] [Serve] Fix deployment state Signed-off-by: Sihan Wang --- python/ray/serve/tests/test_deployment_state.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/ray/serve/tests/test_deployment_state.py b/python/ray/serve/tests/test_deployment_state.py index 671e9390b8654..5f0582ca2a846 100644 --- a/python/ray/serve/tests/test_deployment_state.py +++ b/python/ray/serve/tests/test_deployment_state.py @@ -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 @@ -2471,7 +2470,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 From 691512197221b3657d2178776ac22dab8be73b36 Mon Sep 17 00:00:00 2001 From: Sihan Wang Date: Thu, 28 Sep 2023 13:00:47 -0700 Subject: [PATCH 2/3] Update Signed-off-by: Sihan Wang --- python/ray/serve/tests/test_deployment_state.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/ray/serve/tests/test_deployment_state.py b/python/ray/serve/tests/test_deployment_state.py index 5f0582ca2a846..3e7317ae5ae2c 100644 --- a/python/ray/serve/tests/test_deployment_state.py +++ b/python/ray/serve/tests/test_deployment_state.py @@ -2582,6 +2582,7 @@ 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 + @patch("ray.util.get_placement_group", lambda *args: "test_pg") def test_recover(self): actor_replica = ActorReplicaWrapper( version=deployment_version("1"), From db1492d5f47753cb5c69806f9101eea19db42b68 Mon Sep 17 00:00:00 2001 From: Sihan Wang Date: Thu, 28 Sep 2023 13:33:56 -0700 Subject: [PATCH 3/3] Update Signed-off-by: Sihan Wang --- python/ray/serve/tests/test_deployment_state.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/python/ray/serve/tests/test_deployment_state.py b/python/ray/serve/tests/test_deployment_state.py index 3e7317ae5ae2c..a5207efabe8fc 100644 --- a/python/ray/serve/tests/test_deployment_state.py +++ b/python/ray/serve/tests/test_deployment_state.py @@ -2582,21 +2582,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 - @patch("ray.util.get_placement_group", lambda *args: "test_pg") - def test_recover(self): - actor_replica = ActorReplicaWrapper( - version=deployment_version("1"), - actor_name="test", - detached=False, - 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