Skip to content

Commit

Permalink
tcp tunneling: fix integration test flake (envoyproxy#12267)
Browse files Browse the repository at this point in the history
We need to wait for all listeners to be up.

Fixes envoyproxy#12253 (and maybe other flakes)

Risk Level: None
Testing: Existing tests
Docs Changes: N/A
Release Notes: N/A

Signed-off-by: Matt Klein <[email protected]>
  • Loading branch information
mattklein123 authored Jul 24, 2020
1 parent 6434bbd commit 08464ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 2 additions & 5 deletions test/integration/api_listener_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
});
}
Expand Down
4 changes: 3 additions & 1 deletion test/integration/integration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 08464ec

Please sign in to comment.