From 5ab17e0dd8439bf4b68b20970b68526cb1ef669a Mon Sep 17 00:00:00 2001 From: fangfengbin <869218239a@zju.edu.cn> Date: Thu, 23 Jul 2020 20:28:31 +0800 Subject: [PATCH] Fix TestObjectTableResubscribe testcase bug (#9650) --- .../gcs/gcs_client/test/service_based_gcs_client_test.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) {