increase wait-for-port timeout to accomodate for --release mode and slower machines

This commit is contained in:
James Wilson
2021-07-14 15:14:47 +01:00
parent e34da5761f
commit 86a3edf053
+4 -1
View File
@@ -9,7 +9,7 @@ use tokio::time::Duration;
/// because we want to allow the kernel to assign ports and so don't specify a port as an arg.
pub async fn get_port<R: AsyncRead + Unpin>(reader: R) -> Result<u16, anyhow::Error> {
let expected_text = "listening on http://127.0.0.1:";
wait_for_line_containing(reader, expected_text, Duration::from_secs(30))
wait_for_line_containing(reader, expected_text, Duration::from_secs(60))
.await
.and_then(|line| {
let (_, port_str) = line.rsplit_once(expected_text).unwrap();
@@ -65,6 +65,9 @@ pub async fn connect_multiple_to_uri(
uri: &http::Uri,
num_connections: usize,
) -> Result<Vec<(ws_client::Sender, ws_client::Receiver)>, ws_client::ConnectError> {
// Batch connection establishing to groups of 100 at a time; I found while benchmarking that
// I'd run into "connection reset by peer" issues trying to establish more at once.
let connect_futs = (0..num_connections).map(|_| ws_client::connect(uri));
let sockets: Result<Vec<_>, _> = futures::future::join_all(connect_futs)
.await