Skip to content

Commit

Permalink
attempt, no goaway in fake upstream
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Puncel <[email protected]>
  • Loading branch information
mpuncel committed Nov 18, 2020
1 parent 2b00126 commit 2352719
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/integration/health_check_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ TEST_P(HttpHealthCheckIntegrationTest, SingleEndpointGoAway) {

// Send a GOAWAY with NO_ERROR and then a 200. The health checker should allow the request
// to finish despite the GOAWAY.
clusters_[cluster_idx].host_fake_connection_->onGoAway(Http::GoAwayErrorCode::NoError);
// clusters_[cluster_idx].host_fake_connection_->connection().goAway(Http::GoAwayErrorCode::NoError);
clusters_[cluster_idx].host_fake_connection_->connection().goAway();
clusters_[cluster_idx].host_stream_->encodeHeaders(
Http::TestResponseHeaderMapImpl{{":status", "200"}}, true);

Expand All @@ -290,8 +291,10 @@ TEST_P(HttpHealthCheckIntegrationTest, SingleEndpointGoAwayErrorAndReset) {

// Send a GOAWAY with an error. The health checker should treat this as an
// error and cancel the request.
ASSERT_TRUE(clusters_[cluster_idx].host_fake_connection_->waitForDisconnect());
clusters_[cluster_idx].host_fake_connection_->onGoAway(Http::GoAwayErrorCode::Other);
clusters_[cluster_idx].host_fake_connection_->connection().goAway();
// ASSERT_TRUE(clusters_[cluster_idx].host_fake_connection_->waitForDisconnect(
// std::chrono::milliseconds(1000)));
test_server_->waitForCounterGe("cluster.cluster_1.health_check.failure", 1);
EXPECT_EQ(0, test_server_->counter("cluster.cluster_1.health_check.success")->value());
EXPECT_EQ(1, test_server_->counter("cluster.cluster_1.health_check.failure")->value());
Expand Down

0 comments on commit 2352719

Please sign in to comment.