TEST_P(TcpTunnelingIntegrationTest, Goaway) {
  if (upstreamProtocol() == Http::CodecType::HTTP1) {
    return;
  }
  initialize();

  // Send bidirectional data, including a goaway.
  // This should result in the first connection being torn down.
  setUpConnection(fake_upstream_connection_);
  sendBidiData(fake_upstream_connection_, true);
  closeConnection(fake_upstream_connection_);
  test_server_->waitForCounterGe("cluster.cluster_0.upstream_cx_destroy", 1);

  // Make sure a subsequent connection can be established successfully.
  FakeHttpConnectionPtr fake_upstream_connection;
  setUpConnection(fake_upstream_connection);
  sendBidiData(fake_upstream_connection);
  closeConnection(fake_upstream_connection_);

  // Make sure the last stream is finished before doing test teardown.
  fake_upstream_connection->encodeGoAway();
  test_server_->waitForCounterGe("cluster.cluster_0.upstream_cx_destroy", 2);
}
TEST_P(TcpTunnelingIntegrationTest, Goaway) {
  if (upstreamProtocol() == Http::CodecType::HTTP1) {
    return;
  }
  initialize();

   
   
  setUpConnection(fake_upstream_connection_);
  sendBidiData(fake_upstream_connection_, true);
  closeConnection(fake_upstream_connection_);
  test_server_->waitForCounterGe("cluster.cluster_0.upstream_cx_destroy", 1);

   
  FakeHttpConnectionPtr fake_upstream_connection;
  setUpConnection(fake_upstream_connection);
  sendBidiData(fake_upstream_connection);
  closeConnection(fake_upstream_connection_);

   
  fake_upstream_connection->encodeGoAway();
  test_server_->waitForCounterGe("cluster.cluster_0.upstream_cx_destroy", 2);
}