Fix connection close check in quic_client_interop_test_bin The current connection close check only works if the server sends a connection close in response to ours. The transport draft doesn't require that a peer send a connection close in response to a connection close (though it is the only frame type that can be sent once a connection enters the closing state). It seems perfectly reasonable to declare the connection close procedure has completed with a zero error code if we send a connection close with a zero error code. gfe-relnote: n/a (test-only tool change) PiperOrigin-RevId: 293557827 Change-Id: I1fe90fd65703f061e7d920fb7f20380c0ed38162
diff --git a/quic/tools/quic_client_interop_test_bin.cc b/quic/tools/quic_client_interop_test_bin.cc index 0ea2c7c..e3abbd1 100644 --- a/quic/tools/quic_client_interop_test_bin.cc +++ b/quic/tools/quic_client_interop_test_bin.cc
@@ -251,26 +251,10 @@ } if (connection->connected()) { - test::QuicConnectionPeer::SendConnectionClosePacket( - connection, QUIC_NO_ERROR, "Graceful close"); - const QuicTime close_start_time = epoll_clock.Now(); - static const auto close_timeout = QuicTime::Delta::FromSeconds(10); - while (client->connected()) { - client->epoll_network_helper()->RunEventLoop(); - if (epoll_clock.Now() - close_start_time >= close_timeout) { - QUIC_LOG(ERROR) << "Timed out waiting for connection close"; - AttemptResumption(client.get()); - return; - } - } - const QuicErrorCode received_error = client->session()->error(); - if (received_error == QUIC_NO_ERROR || - received_error == QUIC_PUBLIC_RESET) { - InsertFeature(Feature::kConnectionClose); - } else { - QUIC_LOG(ERROR) << "Received error " << client->session()->error() << " " - << client->session()->error_details(); - } + connection->CloseConnection( + QUIC_NO_ERROR, "Graceful close", + ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); + InsertFeature(Feature::kConnectionClose); } AttemptResumption(client.get());