Merge pull request #22778 from muxi/fix-client-lb-end2end-tests

Fix client_lb_end2end_test flake
pull/22785/head
Muxi Yan 5 years ago committed by GitHub
commit 6b676440f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/core/lib/surface/init.cc
  2. 2
      test/cpp/end2end/client_lb_end2end_test.cc

@ -243,7 +243,7 @@ int grpc_is_initialized(void) {
void grpc_maybe_wait_for_async_shutdown(void) {
gpr_once_init(&g_basic_init, do_basic_init);
grpc_core::MutexLock lock(&g_init_mu);
while (g_shutting_down) {
while (g_shutting_down || g_initializations > 0) {
gpr_cv_wait(g_shutting_down_cv, &g_init_mu,
gpr_inf_future(GPR_CLOCK_REALTIME));
}

@ -50,6 +50,7 @@
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/tcp_client.h"
#include "src/core/lib/security/credentials/fake/fake_credentials.h"
#include "src/core/lib/surface/init.h"
#include "src/cpp/client/secure_credentials.h"
#include "src/cpp/server/secure_server_credentials.h"
@ -239,6 +240,7 @@ class ClientLbEnd2endTest : public ::testing::Test {
servers_.clear();
creds_.reset();
grpc_shutdown_blocking();
grpc_maybe_wait_for_async_shutdown();
}
void CreateServers(size_t num_servers,

Loading…
Cancel
Save