Allow QUIC end_to_end and quic_server tests to pass if the
listening port is specified as 0 to allow Chrome tests to
use 0 instead of attempting to find an unused port (which is
hard).
Also rename QuicPickUnusedPortOrDie to QuicPickServerPortForTestsOrDie
gfe-relnote: n/a - Test only
PiperOrigin-RevId: 265545371
Change-Id: Iab88b60f6348c8e249c6420d895c9775b7f8405c
diff --git a/quic/tools/quic_client_test.cc b/quic/tools/quic_client_test.cc
index 134119b..e2d7f14 100644
--- a/quic/tools/quic_client_test.cc
+++ b/quic/tools/quic_client_test.cc
@@ -65,7 +65,7 @@
// Creates a new QuicClient and Initializes it on an unused port.
// Caller is responsible for deletion.
std::unique_ptr<QuicClient> CreateAndInitializeQuicClient() {
- uint16_t port = QuicPickUnusedPortOrDie();
+ uint16_t port = QuicPickServerPortForTestsOrDie();
QuicSocketAddress server_address(QuicSocketAddress(TestLoopback(), port));
QuicServerId server_id("hostname", server_address.port(), false);
ParsedQuicVersionVector versions = AllSupportedVersions();
@@ -85,7 +85,6 @@
// port exhaustion in long running processes which repeatedly create clients.
// Record the initial number of FDs.
-
size_t number_of_open_fds = NumOpenSocketFDs();
// Create a number of clients, initialize them, and verify this has resulted