[TEST]Fix TestActorSubscribeAll bug (#11297)

Co-authored-by: 灵洵 <fengbin.ffb@antfin.com>
This commit is contained in:
fangfengbin 2020-10-10 02:54:27 +08:00 committed by GitHub
parent 40071739dc
commit ca36105d77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View file

@ -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);
}

View file

@ -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);