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 fd5bff5d6..013406efb 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 @@ -981,12 +981,16 @@ TEST_F(ServiceBasedGcsClientTest, TestObjectTableResubscribe) { // Restart GCS. RestartGcsServer(); + // When GCS client detects that GCS server has restarted, but the pub-sub server + // didn't restart, it will fetch the subscription data again from the GCS server, so + // `object2_change_count` plus 1. + WaitPendingDone(object2_change_count, 2); // Add location of object to GCS again and check if resubscribe works. ASSERT_TRUE(AddLocation(object1_id, node_id)); WaitPendingDone(object1_change_count, 1); ASSERT_TRUE(AddLocation(object2_id, node_id)); - WaitPendingDone(object2_change_count, 2); + WaitPendingDone(object2_change_count, 3); } TEST_F(ServiceBasedGcsClientTest, TestNodeTableResubscribe) {