Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 22 additions & 0 deletions test/integration/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,25 @@ envoy_cc_test(
],
)

envoy_cc_test(
name = "protocol_integration_test",
srcs = [
"protocol_integration_test.cc",
],
# As this test has many H1/H2/v4/v6 tests it takes a while to run.
# Shard it enough to bring the run time in line with other integration tests.
shard_count = 3,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my own edification, how did you pick these shard counts? Maybe a comment here and elsewhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, the first time I ran them they were annoyingly long (I default to a 60s timeout for integration tests) so I just sharded them until they were comparable.
Commented in the build file for posterity :-)

deps = [
":http_protocol_integration_lib",
"//source/common/http:header_map_lib",
"//source/extensions/filters/http/buffer:config",
"//source/extensions/filters/http/dynamo:config",
"//source/extensions/filters/http/health_check:config",
"//test/integration/filters:random_pause_filter_lib",
"//test/test_common:utility_lib",
],
)

envoy_cc_test(
name = "http2_upstream_integration_test",
srcs = [
Expand Down Expand Up @@ -244,6 +263,9 @@ envoy_cc_test_library(
envoy_cc_test(
name = "idle_timeout_integration_test",
srcs = ["idle_timeout_integration_test.cc"],
# As this test has many pauses for idle timeouts, it takes a while to run.
# Shard it enough to bring the run time in line with other integration tests.
shard_count = 2,
deps = [
":http_protocol_integration_lib",
"//test/test_common:test_time_lib",
Expand Down
87 changes: 16 additions & 71 deletions test/integration/http2_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
#include "test/mocks/http/mocks.h"
#include "test/test_common/network_utility.h"
#include "test/test_common/printers.h"
#include "test/test_common/test_base.h"
#include "test/test_common/utility.h"

#include "gtest/gtest.h"

using ::testing::HasSubstr;
using ::testing::MatchesRegex;

Expand All @@ -21,28 +22,6 @@ INSTANTIATE_TEST_SUITE_P(IpVersions, Http2IntegrationTest,
testing::ValuesIn(TestEnvironment::getIpVersionsForTest()),
TestUtility::ipTestParamsToString);

TEST_P(Http2IntegrationTest, RouterNotFound) { testRouterNotFound(); }

TEST_P(Http2IntegrationTest, RouterNotFoundBodyNoBuffer) { testRouterNotFoundWithBody(); }

TEST_P(Http2IntegrationTest, RouterClusterNotFound404) { testRouterClusterNotFound404(); }

TEST_P(Http2IntegrationTest, RouterClusterNotFound503) { testRouterClusterNotFound503(); }

TEST_P(Http2IntegrationTest, RouterRedirect) { testRouterRedirect(); }

TEST_P(Http2IntegrationTest, ValidZeroLengthContent) { testValidZeroLengthContent(); }

TEST_P(Http2IntegrationTest, InvalidContentLength) { testInvalidContentLength(); }

TEST_P(Http2IntegrationTest, MultipleContentLengths) { testMultipleContentLengths(); }

TEST_P(Http2IntegrationTest, ComputedHealthCheck) { testComputedHealthCheck(); }

TEST_P(Http2IntegrationTest, AddEncodedTrailers) { testAddEncodedTrailers(); }

TEST_P(Http2IntegrationTest, DrainClose) { testDrainClose(); }

TEST_P(Http2IntegrationTest, RouterRequestAndResponseWithBodyNoBuffer) {
testRouterRequestAndResponseWithBody(1024, 512, false);
}
Expand All @@ -60,10 +39,6 @@ TEST_P(Http2IntegrationTest, RouterRequestAndResponseLargeHeaderNoBuffer) {
testRouterRequestAndResponseWithBody(1024, 512, true);
}

TEST_P(Http2IntegrationTest, ShutdownWithActiveConnPoolConnections) {
testRequestAndResponseShutdownWithActiveConnection();
}

TEST_P(Http2IntegrationTest, RouterUpstreamDisconnectBeforeRequestcomplete) {
testRouterUpstreamDisconnectBeforeRequestComplete();
}
Expand All @@ -84,16 +59,10 @@ TEST_P(Http2IntegrationTest, RouterUpstreamResponseBeforeRequestComplete) {
testRouterUpstreamResponseBeforeRequestComplete();
}

TEST_P(Http2IntegrationTest, TwoRequests) { testTwoRequests(); }

TEST_P(Http2IntegrationTest, TwoRequestsWithForcedBackup) { testTwoRequests(true); }

TEST_P(Http2IntegrationTest, Retry) { testRetry(); }

TEST_P(Http2IntegrationTest, RetryAttemptCount) { testRetryAttemptCountHeader(); }

TEST_P(Http2IntegrationTest, EnvoyHandling100Continue) { testEnvoyHandling100Continue(); }

static std::string response_metadata_filter = R"EOF(
name: response-metadata-filter
config: {}
Expand Down Expand Up @@ -445,41 +414,25 @@ TEST_P(Http2MetadataIntegrationTest, ProxyMultipleMetadataReachSizeLimit) {
ASSERT_FALSE(response->complete());
}

TEST_P(Http2IntegrationTest, EnvoyHandlingDuplicate100Continue) {
testEnvoyHandling100Continue(true);
}

TEST_P(Http2IntegrationTest, EnvoyProxyingEarly100Continue) { testEnvoyProxying100Continue(true); }

TEST_P(Http2IntegrationTest, EnvoyProxyingLate100Continue) { testEnvoyProxying100Continue(false); }

TEST_P(Http2IntegrationTest, RetryHittingBufferLimit) { testRetryHittingBufferLimit(); }

TEST_P(Http2IntegrationTest, HittingDecoderFilterLimit) { testHittingDecoderFilterLimit(); }

TEST_P(Http2IntegrationTest, HittingEncoderFilterLimit) { testHittingEncoderFilterLimit(); }

TEST_P(Http2IntegrationTest, GrpcRouterNotFound) { testGrpcRouterNotFound(); }

TEST_P(Http2IntegrationTest, RetryHostPredicateFilter) { testRetryHostPredicateFilter(); }
TEST_P(Http2IntegrationTest, GrpcRouterNotFound) {
config_helper_.setDefaultHostAndRoute("foo.com", "/found");
initialize();

TEST_P(Http2IntegrationTest, RetryPriority) { testRetryPriority(); }
BufferingStreamDecoderPtr response = IntegrationUtil::makeSingleRequest(
lookupPort("http"), "POST", "/service/notfound", "", downstream_protocol_, version_, "host",
Http::Headers::get().ContentTypeValues.Grpc);
ASSERT_TRUE(response->complete());
EXPECT_STREQ("200", response->headers().Status()->value().c_str());
EXPECT_EQ(Http::Headers::get().ContentTypeValues.Grpc,
response->headers().ContentType()->value().c_str());
EXPECT_STREQ("12", response->headers().GrpcStatus()->value().c_str());
}

TEST_P(Http2IntegrationTest, GrpcRetry) { testGrpcRetry(); }

TEST_P(Http2IntegrationTest, LargeHeadersInvokeResetStream) { testLargeRequestHeaders(63, 60); }

TEST_P(Http2IntegrationTest, LargeHeadersAcceptedIfConfigured) { testLargeRequestHeaders(63, 64); }

TEST_P(Http2IntegrationTest, EncodingHeaderOnlyResponse) { testHeadersOnlyFilterEncoding(); }

TEST_P(Http2IntegrationTest, DecodingHeaderOnlyResponse) { testHeadersOnlyFilterDecoding(); }
TEST_P(Http2IntegrationTest, LargeHeadersInvokeResetStream) { testLargeRequestHeaders(62, 60); }

TEST_P(Http2IntegrationTest, DecodingHeaderOnlyInterleaved) { testHeadersOnlyFilterInterleaved(); }

TEST_P(Http2IntegrationTest, DownstreamResetBeforeResponseComplete) {
testDownstreamResetBeforeResponseComplete();
}
TEST_P(Http2IntegrationTest, LargeHeadersAcceptedIfConfigured) { testLargeRequestHeaders(62, 63); }

TEST_P(Http2IntegrationTest, BadMagic) {
initialize();
Expand Down Expand Up @@ -568,14 +521,6 @@ TEST_P(Http2IntegrationTest, GrpcRequestTimeout) {
EXPECT_LT(0, test_server_->counter("cluster.cluster_0.upstream_rq_timeout")->value());
}

// Tests idle timeout behaviour with single request and validates that idle timer kicks in
// after given timeout.
TEST_P(Http2IntegrationTest, IdleTimoutBasic) { testIdleTimeoutBasic(); }

// Tests idle timeout behaviour with multiple requests and validates that idle timer kicks in
// after both the requests are done.
TEST_P(Http2IntegrationTest, IdleTimeoutWithTwoRequests) { testIdleTimeoutWithTwoRequests(); }

// Interleave two requests and responses and make sure that idle timeout is handled correctly.
TEST_P(Http2IntegrationTest, IdleTimeoutWithSimultaneousRequests) {
FakeHttpConnectionPtr fake_upstream_connection1;
Expand Down
32 changes: 0 additions & 32 deletions test/integration/http2_upstream_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ INSTANTIATE_TEST_SUITE_P(IpVersions, Http2UpstreamIntegrationTest,
testing::ValuesIn(TestEnvironment::getIpVersionsForTest()),
TestUtility::ipTestParamsToString);

TEST_P(Http2UpstreamIntegrationTest, RouterNotFound) { testRouterNotFound(); }

TEST_P(Http2UpstreamIntegrationTest, RouterRedirect) { testRouterRedirect(); }

TEST_P(Http2UpstreamIntegrationTest, ComputedHealthCheck) { testComputedHealthCheck(); }

TEST_P(Http2UpstreamIntegrationTest, AddEncodedTrailers) { testAddEncodedTrailers(); }

TEST_P(Http2UpstreamIntegrationTest, DrainClose) { testDrainClose(); }

TEST_P(Http2UpstreamIntegrationTest, RouterRequestAndResponseWithBodyNoBuffer) {
testRouterRequestAndResponseWithBody(1024, 512, false);
}
Expand Down Expand Up @@ -57,32 +47,10 @@ TEST_P(Http2UpstreamIntegrationTest, RouterUpstreamResponseBeforeRequestComplete
testRouterUpstreamResponseBeforeRequestComplete();
}

TEST_P(Http2UpstreamIntegrationTest, TwoRequests) { testTwoRequests(); }

TEST_P(Http2UpstreamIntegrationTest, Retry) { testRetry(); }

TEST_P(Http2UpstreamIntegrationTest, EnvoyHandling100Continue) { testEnvoyHandling100Continue(); }

TEST_P(Http2UpstreamIntegrationTest, EnvoyHandlingDuplicate100Continue) {
testEnvoyHandling100Continue(true);
}

TEST_P(Http2UpstreamIntegrationTest, EnvoyProxyingEarly100Continue) {
testEnvoyProxying100Continue(true);
}

TEST_P(Http2UpstreamIntegrationTest, EnvoyProxyingLate100Continue) {
testEnvoyProxying100Continue(false);
}

TEST_P(Http2UpstreamIntegrationTest, RetryHittingBufferLimit) { testRetryHittingBufferLimit(); }

TEST_P(Http2UpstreamIntegrationTest, GrpcRetry) { testGrpcRetry(); }

TEST_P(Http2UpstreamIntegrationTest, DownstreamResetBeforeResponseComplete) {
testDownstreamResetBeforeResponseComplete();
}

TEST_P(Http2UpstreamIntegrationTest, Trailers) { testTrailers(1024, 2048); }

// Ensure Envoy handles streaming requests and responses simultaneously.
Expand Down
Loading