Skip to content

Commit

Permalink
Deflake gcs_client_test.cc (ray-project#34411)
Browse files Browse the repository at this point in the history
Hypothesis is that on_subscribe callback is invoked after test finishes; the reference to the stack-allocated atomic counter is no longer valid, causing asan failure.

Signed-off-by: Jack He <[email protected]>
  • Loading branch information
cadedaniel authored and ProjectsByJackHe committed May 4, 2023
1 parent 9f1c9f8 commit b931ce9
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/ray/gcs/gcs_client/test/gcs_client_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -513,11 +513,7 @@ TEST_P(GcsClientTest, TestActorInfo) {
ActorID actor_id = ActorID::FromBinary(actor_table_data->actor_id());

// Subscribe to any update operations of an actor.
std::atomic<int> actor_update_count(0);
auto on_subscribe = [&actor_update_count](const ActorID &actor_id,
const gcs::ActorTableData &data) {
++actor_update_count;
};
auto on_subscribe = [](const ActorID &actor_id, const gcs::ActorTableData &data) {};
ASSERT_TRUE(SubscribeActor(actor_id, on_subscribe));

// Register an actor to GCS.
Expand Down

0 comments on commit b931ce9

Please sign in to comment.