From 8ef33274635757e97f3e125129a80bc21de17068 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 12 Sep 2024 23:13:47 +0000 Subject: [PATCH] [xds_core_e2e_test] ensure server is serving before starting client --- test/cpp/end2end/xds/xds_core_end2end_test.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/cpp/end2end/xds/xds_core_end2end_test.cc b/test/cpp/end2end/xds/xds_core_end2end_test.cc index 4ff39e4b234..04642dc873f 100644 --- a/test/cpp/end2end/xds/xds_core_end2end_test.cc +++ b/test/cpp/end2end/xds/xds_core_end2end_test.cc @@ -1060,7 +1060,7 @@ TEST_P(XdsFederationTest, FederationServer) { "xdstp://xds.example.com/envoy.config.listener.v3.Listener" "client/%s?client_listener_resource_name_template_not_in_use"); InitClient(builder); - CreateAndStartBackends(2, /*xds_enabled=*/true); + CreateBackends(2, /*xds_enabled=*/true); // Eds for new authority balancer. EdsResourceArgs args = EdsResourceArgs({{"locality0", CreateEndpointsForBackends()}}); @@ -1099,6 +1099,13 @@ TEST_P(XdsFederationTest, FederationServer) { new_server_route_config, ServerHcmAccessor()); } + // Start backends and wait for them to start serving. + StartAllBackends(); + for (const auto& backend : backends_) { + ASSERT_TRUE(backend->notifier()->WaitOnServingStatusChange( + grpc_core::LocalIpAndPort(backend->port()), grpc::StatusCode::OK)); + } + // Make sure everything works. WaitForAllBackends(DEBUG_LOCATION); }