Skip to content

Commit

Permalink
fix flake in TcpTunnelingIntegrationTest.UpstreamHttpFiltersPauseAndR…
Browse files Browse the repository at this point in the history
…esume (#35917)

fixes: #35523

Signed-off-by: Vikas Choudhary (vikasc) <[email protected]>
  • Loading branch information
vikaschoudhary16 authored Sep 5, 2024
1 parent b0da125 commit 57fc112
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/integration/tcp_tunneling_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -982,10 +982,19 @@ TEST_P(TcpTunnelingIntegrationTest, UpstreamHttpFiltersPauseAndResume) {
// Send upgrade headers downstream, fully establishing the connection.
upstream_request_->encodeHeaders(default_response_headers_, false);

bool verify_no_remote_close = true;
if (upstreamProtocol() == Http::CodecType::HTTP1) {
// in HTTP1 case, the connection is closed on stream reset and therefore, it
// is possible to detect a remote close if remote FIN event gets processed before local close
// socket event. By sending verify_no_remote_close as false to the write function, we are
// allowing the test to pass even if remote close is detected.
verify_no_remote_close = false;
}
// send some data to pause the filter
ASSERT_TRUE(tcp_client_->write("hello", false));
ASSERT_TRUE(tcp_client_->write("hello", false, verify_no_remote_close));
// send end stream to resume the filter
ASSERT_TRUE(tcp_client_->write("hello", true));
ASSERT_TRUE(tcp_client_->write("hello", true, verify_no_remote_close));

ASSERT_TRUE(upstream_request_->waitForData(*dispatcher_, 10));

// Finally close and clean up.
Expand Down

0 comments on commit 57fc112

Please sign in to comment.