From ab2afbc3e108363a38fb1ac869d3df00426ef130 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Fri, 6 Sep 2024 16:59:43 -0700 Subject: [PATCH] [XdsEnabledServerTest] Wait on serving status to change (#37654) Fixes flakes in xds_end2end_test for XdsEnabledServerTest where the updates for the control plane were not applied in time. The change here waits for the server to notify that the serving status is OK before sending RPCs. Flakes fixed are of the kind - https://btx.cloud.google.com/invocations/3b8f68a9-268c-4ad9-81dd-8a099a871537/targets/%2F%2Ftest%2Fcpp%2Fend2end%2Fxds:xds_end2end_test@poller%3Dpoll;shard=32;config=f78d0de70f525043d29a05fb7a78970999e04b7f8a87d8c4e974688bf7616998/log Closes #37654 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37654 from yashykt:XdsServerTestWait 2ab37ba08963cc4a045c039d629afe9c39853437 PiperOrigin-RevId: 671933629 --- test/cpp/end2end/xds/xds_end2end_test.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/cpp/end2end/xds/xds_end2end_test.cc b/test/cpp/end2end/xds/xds_end2end_test.cc index 0c6cfab5e84..b443643a7d0 100644 --- a/test/cpp/end2end/xds/xds_end2end_test.cc +++ b/test/cpp/end2end/xds/xds_end2end_test.cc @@ -833,12 +833,16 @@ class XdsEnabledServerTest : public XdsEnd2endTest { TEST_P(XdsEnabledServerTest, Basic) { DoSetUp(); backends_[0]->Start(); + backends_[0]->notifier()->WaitOnServingStatusChange( + grpc_core::LocalIpAndPort(backends_[0]->port()), grpc::StatusCode::OK); WaitForBackend(DEBUG_LOCATION, 0); } TEST_P(XdsEnabledServerTest, ListenerDeletionIgnored) { DoSetUp(MakeBootstrapBuilder().SetIgnoreResourceDeletion()); backends_[0]->Start(); + backends_[0]->notifier()->WaitOnServingStatusChange( + grpc_core::LocalIpAndPort(backends_[0]->port()), grpc::StatusCode::OK); WaitForBackend(DEBUG_LOCATION, 0); // Check that we ACKed. // TODO(roth): There may be multiple entries in the resource state response