Skip to content

Commit

Permalink
[XdsCoreE2ETest] Wait for xds enabled servers to be serving
Browse files Browse the repository at this point in the history
  • Loading branch information
yashykt committed Oct 17, 2024
1 parent 7e06934 commit 024446f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/cpp/end2end/xds/xds_core_end2end_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,10 @@ TEST_P(XdsFederationTest, FederationServer) {
"client/%s?client_listener_resource_name_template_not_in_use");
InitClient(builder);
CreateBackends(2, /*xds_enabled=*/true);
ASSERT_TRUE(backends_[0]->notifier()->WaitOnServingStatusChange(
grpc_core::LocalIpAndPort(backends_[0]->port()), grpc::StatusCode::OK));
ASSERT_TRUE(backends_[1]->notifier()->WaitOnServingStatusChange(
grpc_core::LocalIpAndPort(backends_[1]->port()), grpc::StatusCode::OK));
// Eds for new authority balancer.
EdsResourceArgs args =
EdsResourceArgs({{"locality0", CreateEndpointsForBackends()}});
Expand Down Expand Up @@ -1247,6 +1251,8 @@ TEST_P(XdsMetricsTest, MetricValues) {
const std::string kTarget = absl::StrCat("xds:", kServerName);
const std::string kXdsServer = absl::StrCat("localhost:", balancer_->port());
CreateAndStartBackends(1, /*xds_enabled=*/true);
ASSERT_TRUE(backends_[0]->notifier()->WaitOnServingStatusChange(
grpc_core::LocalIpAndPort(backends_[0]->port()), grpc::StatusCode::OK));
EdsResourceArgs args =
EdsResourceArgs({{"locality0", CreateEndpointsForBackends()}});
balancer_->ads_service()->SetEdsResource(BuildEdsResource(args));
Expand Down Expand Up @@ -1424,6 +1430,10 @@ TEST_P(XdsFederationLoadReportingTest, FederationMultipleLoadReportingTest) {
kNewListenerTemplate);
InitClient(builder);
CreateAndStartBackends(2, /*xds_enabled=*/true);
ASSERT_TRUE(backends_[0]->notifier()->WaitOnServingStatusChange(
grpc_core::LocalIpAndPort(backends_[0]->port()), grpc::StatusCode::OK));
ASSERT_TRUE(backends_[1]->notifier()->WaitOnServingStatusChange(
grpc_core::LocalIpAndPort(backends_[1]->port()), grpc::StatusCode::OK));
// Eds for 2 balancers to ensure RPCs sent using current stub go to backend 0
// and RPCs sent using the new stub go to backend 1.
EdsResourceArgs args({{"locality0", CreateEndpointsForBackends(0, 1)}});
Expand Down

0 comments on commit 024446f

Please sign in to comment.