[metrics] Fix test flakiness (#38128)

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #38128

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38128 from yashykt:TestMetricstestFlakiness 4ac65b2d80
PiperOrigin-RevId: 697000317
pull/38146/head
Yash Tibrewal 1 week ago committed by Copybara-Service
parent 10fa208979
commit 9166bb962c
  1. 2
      test/core/telemetry/metrics_test.cc

@ -669,6 +669,8 @@ TEST_F(MetricsTest, ParallelStatsPluginRegistrationAndLookup) {
while (GlobalStatsPluginRegistry::GetStatsPluginsForChannel(
StatsPluginChannelScope("", "", endpoint_config_))
.size() < 10000) {
// Yield to avoid starving the register threads.
std::this_thread::yield();
};
});
}

Loading…
Cancel
Save