From 08464ecdc0c93846f3d039d0f0c6fed935f5bdc8 Mon Sep 17 00:00:00 2001 From: Matt Klein Date: Thu, 23 Jul 2020 22:54:21 -0700 Subject: [PATCH] tcp tunneling: fix integration test flake (#12267) We need to wait for all listeners to be up. Fixes https://github.com/envoyproxy/envoy/issues/12253 (and maybe other flakes) Risk Level: None Testing: Existing tests Docs Changes: N/A Release Notes: N/A Signed-off-by: Matt Klein --- test/integration/api_listener_integration_test.cc | 7 ++----- test/integration/integration.cc | 4 +++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/test/integration/api_listener_integration_test.cc b/test/integration/api_listener_integration_test.cc index c71d57506b7c..0005e9a83f56 100644 --- a/test/integration/api_listener_integration_test.cc +++ b/test/integration/api_listener_integration_test.cc @@ -19,15 +19,12 @@ class ApiListenerIntegrationTest : public BaseIntegrationTest, ApiListenerIntegrationTest() : BaseIntegrationTest(GetParam(), bootstrapConfig()) { use_lds_ = false; autonomous_upstream_ = true; + defer_listener_finalization_ = true; } void SetUp() override { config_helper_.addConfigModifier([](envoy::config::bootstrap::v3::Bootstrap& bootstrap) { - // currently ApiListener does not trigger this wait - // https://github.com/envoyproxy/envoy/blob/0b92c58d08d28ba7ef0ed5aaf44f90f0fccc5dce/test/integration/integration.cc#L454 - // Thus, the ApiListener has to be added in addition to the already existing listener in the - // config. - bootstrap.mutable_static_resources()->add_listeners()->MergeFrom( + bootstrap.mutable_static_resources()->mutable_listeners(0)->MergeFrom( Server::parseListenerFromV2Yaml(apiListenerConfig())); }); } diff --git a/test/integration/integration.cc b/test/integration/integration.cc index f471ca50bbb8..f71a577dc6e3 100644 --- a/test/integration/integration.cc +++ b/test/integration/integration.cc @@ -490,7 +490,9 @@ void BaseIntegrationTest::createGeneratedApiTestServer( const char* rejected = "listener_manager.lds.update_rejected"; for (Stats::CounterSharedPtr success_counter = test_server_->counter(success), rejected_counter = test_server_->counter(rejected); - (success_counter == nullptr || success_counter->value() < concurrency_) && + (success_counter == nullptr || + success_counter->value() < + concurrency_ * config_helper_.bootstrap().static_resources().listeners_size()) && (!allow_lds_rejection || rejected_counter == nullptr || rejected_counter->value() == 0); success_counter = test_server_->counter(success), rejected_counter = test_server_->counter(rejected)) {