Skip to content

Commit

Permalink
test: making assert required
Browse files Browse the repository at this point in the history
Signed-off-by: Alyssa Wilk <[email protected]>
  • Loading branch information
alyssawilk committed Apr 14, 2021
1 parent 5860602 commit a600850
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ TEST_P(CompositeFilterIntegrationTest, TestBasic) {
waitForNextUpstreamRequest();

upstream_request_->encodeHeaders(Http::TestResponseHeaderMapImpl{{":status", "200"}}, true);
response->waitForEndStream();
ASSERT_TRUE(response->waitForEndStream());
EXPECT_THAT(response->headers(), Http::HttpStatusIs("200"));
}

Expand All @@ -73,7 +73,7 @@ TEST_P(CompositeFilterIntegrationTest, TestBasic) {
{"match-header", "match"},
{":authority", "blah"}};
auto response = codec_client_->makeRequestWithBody(request_headers, 1024);
response->waitForEndStream();
ASSERT_TRUE(response->waitForEndStream());
EXPECT_THAT(response->headers(), Http::HttpStatusIs("403"));
}
}
Expand Down
12 changes: 6 additions & 6 deletions test/integration/extension_discovery_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -333,15 +333,15 @@ TEST_P(ExtensionDiscoveryIntegrationTest, BasicSuccessWithTtl) {
Http::TestRequestHeaderMapImpl request_headers{
{":method", "GET"}, {":path", "/"}, {":scheme", "http"}, {":authority", "host"}};
auto response = codec_client_->makeHeaderOnlyRequest(request_headers);
response->waitForEndStream();
ASSERT_TRUE(response->waitForEndStream());
ASSERT_TRUE(response->complete());
EXPECT_EQ("200", response->headers().getStatusValue());
}
Http::TestRequestHeaderMapImpl banned_request_headers{
{":method", "GET"}, {":path", "/private/key"}, {":scheme", "http"}, {":authority", "host"}};
{
auto response = codec_client_->makeHeaderOnlyRequest(banned_request_headers);
response->waitForEndStream();
ASSERT_TRUE(response->waitForEndStream());
ASSERT_TRUE(response->complete());
EXPECT_EQ("403", response->headers().getStatusValue());
}
Expand All @@ -352,7 +352,7 @@ TEST_P(ExtensionDiscoveryIntegrationTest, BasicSuccessWithTtl) {
test_server_->waitForCounterGe("http.config_test.extension_config_discovery.foo.config_reload",
2);
auto response = codec_client_->makeHeaderOnlyRequest(banned_request_headers);
response->waitForEndStream();
ASSERT_TRUE(response->waitForEndStream());
ASSERT_TRUE(response->complete());
EXPECT_EQ("500", response->headers().getStatusValue());
}
Expand All @@ -364,7 +364,7 @@ TEST_P(ExtensionDiscoveryIntegrationTest, BasicSuccessWithTtl) {
test_server_->waitForCounterGe("http.config_test.extension_config_discovery.foo.config_reload",
3);
auto response = codec_client_->makeHeaderOnlyRequest(banned_request_headers);
response->waitForEndStream();
ASSERT_TRUE(response->waitForEndStream());
ASSERT_TRUE(response->complete());
EXPECT_EQ("403", response->headers().getStatusValue());
}
Expand All @@ -389,7 +389,7 @@ TEST_P(ExtensionDiscoveryIntegrationTest, BasicSuccessWithTtlWithDefault) {
{":method", "GET"}, {":path", "/private/key"}, {":scheme", "http"}, {":authority", "host"}};
{
auto response = codec_client_->makeHeaderOnlyRequest(banned_request_headers);
response->waitForEndStream();
ASSERT_TRUE(response->waitForEndStream());
ASSERT_TRUE(response->complete());
EXPECT_EQ("200", response->headers().getStatusValue());
}
Expand All @@ -400,7 +400,7 @@ TEST_P(ExtensionDiscoveryIntegrationTest, BasicSuccessWithTtlWithDefault) {
test_server_->waitForCounterGe("http.config_test.extension_config_discovery.foo.config_reload",
2);
auto response = codec_client_->makeHeaderOnlyRequest(banned_request_headers);
response->waitForEndStream();
ASSERT_TRUE(response->waitForEndStream());
ASSERT_TRUE(response->complete());
EXPECT_EQ("403", response->headers().getStatusValue());
}
Expand Down
2 changes: 1 addition & 1 deletion test/integration/integration_stream_decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class IntegrationStreamDecoder : public Http::ResponseDecoder, public Http::Stre
// can be used if the previous body data is not relevant and the test wants to wait for a specific
// amount of new data without considering the existing body size.
void waitForBodyData(uint64_t size);
testing::AssertionResult
ABSL_MUST_USE_RESULT testing::AssertionResult
waitForEndStream(std::chrono::milliseconds timeout = TestUtility::DefaultTimeout);
void waitForReset();
void clearBody() { body_.clear(); }
Expand Down
2 changes: 1 addition & 1 deletion test/integration/quic_http_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ TEST_P(QuicHttpIntegrationTest, ResetRequestWithoutAuthorityHeader) {
request_encoder_ = &encoder_decoder.first;
auto response = std::move(encoder_decoder.second);

response->waitForEndStream();
ASSERT_TRUE(response->waitForEndStream());
codec_client_->close();
ASSERT_TRUE(response->complete());
EXPECT_EQ("400", response->headers().getStatusValue());
Expand Down

0 comments on commit a600850

Please sign in to comment.