diff --git a/test/integration/cx_limit_integration_test.cc b/test/integration/cx_limit_integration_test.cc index abdc5711fe2eb..126c5c2366646 100644 --- a/test/integration/cx_limit_integration_test.cc +++ b/test/integration/cx_limit_integration_test.cc @@ -37,6 +37,24 @@ class ConnectionLimitIntegrationTest : public testing::TestWithParam init_func, std::string&& check_stat) { init_func(); @@ -68,6 +86,8 @@ class ConnectionLimitIntegrationTest : public testing::TestWithParamclose(); ASSERT_TRUE(raw_conns.front()->waitForDisconnect()); + // Make sure to not try to connect again until the acceptedSocketCount is updated. + ASSERT_TRUE(waitForConnections(1)); tcp_clients.emplace_back(makeTcpConnection(lookupPort("listener_0"))); raw_conns.emplace_back(); ASSERT_TRUE(fake_upstreams_[0]->waitForRawConnection(raw_conns.back()));