TEST_P(ProtocolIntegrationTest, HeaderAndBodyWireBytesCountReuseUpstream) {
  // We only care about the upstream protocol.
  if (downstreamProtocol() != Http::CodecType::HTTP2) {
    return;
  }

  useAccessLog("%UPSTREAM_WIRE_BYTES_SENT% %UPSTREAM_WIRE_BYTES_RECEIVED% "
               "%UPSTREAM_HEADER_BYTES_SENT% %UPSTREAM_HEADER_BYTES_RECEIVED%");

  initialize();
  codec_client_ = makeHttpConnection(makeClientConnection(lookupPort("http")));
  auto second_client = makeHttpConnection(makeClientConnection(lookupPort("http")));
  const int request_size = 100;
  const int response_size = 100;

  // Send to the same upstream from the two clients.
  auto response_one = sendRequestAndWaitForResponse(default_request_headers_, request_size,
                                                    default_response_headers_, response_size, 0);
  expectUpstreamBytesSentAndReceived(BytesCountExpectation(298, 158, 156, 27),
                                     BytesCountExpectation(223, 122, 114, 13),
                                     BytesCountExpectation(223, 108, 114, 3), 0);

  // Swap clients so the other connection is used to send the request.
  std::swap(codec_client_, second_client);
  auto response_two = sendRequestAndWaitForResponse(default_request_headers_, request_size,
                                                    default_response_headers_, response_size, 0);
  expectUpstreamBytesSentAndReceived(BytesCountExpectation(298, 158, 156, 27),
                                     BytesCountExpectation(167, 119, 58, 10),
                                     BytesCountExpectation(114, 108, 11, 3), 1);
  second_client->close();
}
TEST_P(ProtocolIntegrationTest, HeaderAndBodyWireBytesCountReuseUpstream) {
   
  if (downstreamProtocol() != Http::CodecType::HTTP2) {
    return;
  }

  useAccessLog("%UPSTREAM_WIRE_BYTES_SENT% %UPSTREAM_WIRE_BYTES_RECEIVED% "
               "%UPSTREAM_HEADER_BYTES_SENT% %UPSTREAM_HEADER_BYTES_RECEIVED%");

  initialize();
  codec_client_ = makeHttpConnection(makeClientConnection(lookupPort("http")));
  auto second_client = makeHttpConnection(makeClientConnection(lookupPort("http")));
  const int request_size = 100;
  const int response_size = 100;

   
  auto response_one = sendRequestAndWaitForResponse(default_request_headers_, request_size,
                                                    default_response_headers_, response_size, 0);
  expectUpstreamBytesSentAndReceived(BytesCountExpectation(298, 158, 156, 27),
                                     BytesCountExpectation(223, 122, 114, 13),
                                     BytesCountExpectation(223, 108, 114, 3), 0);

   
  std::swap(codec_client_, second_client);
  auto response_two = sendRequestAndWaitForResponse(default_request_headers_, request_size,
                                                    default_response_headers_, response_size, 0);
  expectUpstreamBytesSentAndReceived(BytesCountExpectation(298, 158, 156, 27),
                                     BytesCountExpectation(167, 119, 58, 10),
                                     BytesCountExpectation(114, 108, 11, 3), 1);
  second_client->close();
}