From 1ed28f882f6acdde59ed23c2d227532d634dd484 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Mon, 9 Sep 2024 08:38:39 -0700 Subject: [PATCH] [xDS e2e tests] fix flake in metric test (#37653) Closes #37653 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37653 from markdroth:xds_e2e_metric_test_flake 57dad466b7e12d843129e0071feb452d68727fdc PiperOrigin-RevId: 672556528 --- test/cpp/end2end/xds/xds_core_end2end_test.cc | 5 ++++- 1 file changed, 4 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 f3b6d78f901..4ff39e4b234 100644 --- a/test/cpp/end2end/xds/xds_core_end2end_test.cc +++ b/test/cpp/end2end/xds/xds_core_end2end_test.cc @@ -1244,7 +1244,10 @@ TEST_P(XdsMetricsTest, MetricValues) { EdsResourceArgs args = EdsResourceArgs({{"locality0", CreateEndpointsForBackends()}}); balancer_->ads_service()->SetEdsResource(BuildEdsResource(args)); - CheckRpcSendOk(DEBUG_LOCATION); + // Use wait_for_ready and increase timeout, in case the client takes a + // little while to get connected. + CheckRpcSendOk(DEBUG_LOCATION, /*times=*/1, + RpcOptions().set_wait_for_ready(true).set_timeout_ms(15000)); stats_plugin_->TriggerCallbacks(); // Check client metrics. EXPECT_THAT(stats_plugin_->GetInt64CallbackGaugeValue(