Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions test/integration/listener_lds_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,7 @@ class RebalancerTest : public testing::TestWithParam<Network::Address::IpVersion
virtual_listener_config.set_name("balanced_target_listener");
virtual_listener_config.mutable_connection_balance_config()->mutable_exact_balance();

// 127.0.0.2 is defined in FakeOriginalDstListenerFilter. This virtual listener does not
// listen on a passive socket so it's safe to use any ip address.
// TODO(lambdai): Replace by getLoopbackAddressUrlString to emulate the real world.
*virtual_listener_config.mutable_address()->mutable_socket_address()->mutable_address() =
"127.0.0.2";
virtual_listener_config.mutable_address()->mutable_socket_address()->set_port_value(80);
Expand Down Expand Up @@ -539,7 +538,11 @@ struct PerConnection {

// Verify the connections are distributed evenly on the 2 worker threads of the redirected
// listener.
TEST_P(RebalancerTest, RedirectConnectionIsBalancedOnDestinationListener) {
// Currently flaky because the virtual listener create listen socket anyway despite the socket is
// never used. Will enable this test once https://github.com/envoyproxy/envoy/pull/16259 is merged.
TEST_P(RebalancerTest, DISABLED_RedirectConnectionIsBalancedOnDestinationListener) {
auto ip_address_str =
Network::Test::getLoopbackAddressUrlString(TestEnvironment::getIpVersionsForTest().front());
concurrency_ = 2;
int repeats = 10;
initialize();
Expand All @@ -561,14 +564,14 @@ TEST_P(RebalancerTest, RedirectConnectionIsBalancedOnDestinationListener) {
}
}

ASSERT_EQ(TestUtility::findCounter(test_server_->statStore(),
"listener.127.0.0.2_80.worker_0.downstream_cx_total")

ASSERT_EQ(TestUtility::findCounter(
test_server_->statStore(),
absl::StrCat("listener.", ip_address_str, "_80.worker_0.downstream_cx_total"))
->value(),
repeats);
ASSERT_EQ(TestUtility::findCounter(test_server_->statStore(),
"listener.127.0.0.2_80.worker_1.downstream_cx_total")

ASSERT_EQ(TestUtility::findCounter(
test_server_->statStore(),
absl::StrCat("listener.", ip_address_str, "_80.worker_1.downstream_cx_total"))
->value(),
repeats);
}
Expand Down