Skip to content

Commit

Permalink
Add validation of H/2 max concurrent streams (envoyproxy#29952)
Browse files Browse the repository at this point in the history
Signed-off-by: Yan Avlasov <yavlasov@google.com>
  • Loading branch information
yanavlasov committed Oct 6, 2023
1 parent 95b6951 commit fda134a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/integration/multiplexed_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1829,6 +1829,26 @@ class Http2FrameIntegrationTest : public testing::TestWithParam<FrameIntegration
}
};

TEST_P(Http2FrameIntegrationTest, MaxConcurrentStreamsIsRespected) {
const int kTotalRequests = 101;
config_helper_.addConfigModifier(
[&](envoy::extensions::filters::network::http_connection_manager::v3::HttpConnectionManager&
hcm) -> void {
hcm.mutable_http2_protocol_options()->mutable_max_concurrent_streams()->set_value(100);
});
beginSession();

std::string buffer;
for (int i = 0; i < kTotalRequests; ++i) {
auto request = Http2Frame::makeRequest(Http2Frame::makeClientStreamId(i), "a", "/");
absl::StrAppend(&buffer, std::string(request));
}

ASSERT_TRUE(tcp_client_->write(buffer, false, false));
tcp_client_->waitForDisconnect();
test_server_->waitForCounterGe("http.config_test.downstream_cx_destroy_local", 1);
}

// Regression test.
TEST_P(Http2FrameIntegrationTest, SetDetailsTwice) {
autonomous_upstream_ = true;
Expand Down

0 comments on commit fda134a

Please sign in to comment.