mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-04-29 18:27:58 +00:00
increase wait-for-port timeout to accomodate for --release mode and slower machines
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user