diff --git a/src/ray/gcs/gcs_client/test/service_based_gcs_client_test.cc b/src/ray/gcs/gcs_client/test/service_based_gcs_client_test.cc index 946cb72cf..43f5e55bf 100644 --- a/src/ray/gcs/gcs_client/test/service_based_gcs_client_test.cc +++ b/src/ray/gcs/gcs_client/test/service_based_gcs_client_test.cc @@ -171,6 +171,14 @@ class ServiceBasedGcsClientTest : public ::testing::Test { message.set_parent_task_id(TaskID::ForActorCreationTask(actor_id).Binary()); message.mutable_actor_creation_task_spec()->set_actor_id(actor_id.Binary()); message.mutable_actor_creation_task_spec()->set_is_detached(is_detached); + // If the actor is non-detached, the `WaitForActorOutOfScope` function of the core + // worker client is called during the actor registration process. In order to simulate + // the scenario of registration failure, we set the address to an illegal value. + if (!is_detached) { + rpc::Address address; + address.set_ip_address(""); + message.mutable_caller_address()->CopyFrom(address); + } TaskSpecification task_spec(message); if (skip_wait) { @@ -657,8 +665,8 @@ TEST_F(ServiceBasedGcsClientTest, TestActorSubscribeAll) { ASSERT_TRUE(SubscribeAllActors(on_subscribe)); // Register an actor to GCS. - ASSERT_FALSE(RegisterActor(actor_table_data1, false)); - ASSERT_FALSE(RegisterActor(actor_table_data2, false)); + RegisterActor(actor_table_data1, false); + RegisterActor(actor_table_data2, false); WaitForExpectedCount(actor_update_count, 2); } diff --git a/src/ray/gcs/gcs_server/gcs_actor_manager.cc b/src/ray/gcs/gcs_server/gcs_actor_manager.cc index e3549443e..e45ee90ac 100644 --- a/src/ray/gcs/gcs_server/gcs_actor_manager.cc +++ b/src/ray/gcs/gcs_server/gcs_actor_manager.cc @@ -542,7 +542,7 @@ void GcsActorManager::PollOwnerForActorOutOfScope( RAY_LOG(INFO) << "Worker " << owner_id << " failed, destroying actor child."; } else { RAY_LOG(INFO) << "Actor " << actor_id - << " is out of scope,, destroying actor child."; + << " is out of scope, destroying actor child."; } auto node_it = owners_.find(owner_node_id);