Skip to content

Commit b6d5d04

Browse files
botengyaophlax
authored andcommitted
fix tests
Signed-off-by: Boteng Yao <[email protected]>
1 parent 9d66819 commit b6d5d04

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/extensions/filters/http/lua/lua_integration_test.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,15 @@ class LuaIntegrationTest : public UpstreamDownstreamIntegrationTest {
4646
return ret;
4747
}
4848

49-
void initializeFilter(const std::string& filter_config, const std::string& domain = "*") {
49+
void initializeFilter(const std::string& filter_config, const std::string& domain = "*",
50+
bool test_large_body = false) {
5051
config_helper_.prependFilter(filter_config, testing_downstream_filter_);
5152

5253
// Create static clusters.
5354
createClusters();
5455

5556
config_helper_.addConfigModifier(
56-
[domain](
57+
[domain, test_large_body, this](
5758
envoy::extensions::filters::network::http_connection_manager::v3::HttpConnectionManager&
5859
hcm) {
5960
hcm.mutable_route_config()
@@ -70,6 +71,10 @@ class LuaIntegrationTest : public UpstreamDownstreamIntegrationTest {
7071
new_route->mutable_response_headers_to_add()->Add()->mutable_header();
7172
response_header->set_key("fake_header");
7273
response_header->set_value("fake_value");
74+
if (downstream_protocol_ == Http::CodecType::HTTP2 && test_large_body) {
75+
hcm.mutable_http2_protocol_options()->mutable_initial_stream_window_size()->set_value(
76+
16 * 1024 * 1024);
77+
}
7378

7479
const std::string key = "envoy.filters.http.lua";
7580
const std::string yaml =
@@ -247,7 +252,7 @@ class LuaIntegrationTest : public UpstreamDownstreamIntegrationTest {
247252
}
248253

249254
IntegrationStreamDecoderPtr initializeAndSendRequest(const std::string& code) {
250-
initializeFilter(code);
255+
initializeFilter(code, "*", true);
251256
codec_client_ = makeHttpConnection(makeClientConnection(lookupPort("http")));
252257
Http::TestRequestHeaderMapImpl request_headers{{":method", "POST"},
253258
{":path", "/test/long/url"},

0 commit comments

Comments
 (0)