chore: adjust timeout for wait_for_port

This commit is contained in:
sigoden
2024-11-16 17:46:54 +08:00
parent f27f9e997f
commit bc6c573acb
2 changed files with 13 additions and 8 deletions

View File

@@ -146,14 +146,14 @@ where
TestServer::new(port, tmpdir, child, is_tls)
}
/// Wait a max of 1s for the port to become available.
/// Wait a max of 2s for the port to become available.
pub fn wait_for_port(port: u16) {
let start_wait = Instant::now();
while !port_check::is_port_reachable(format!("localhost:{port}")) {
sleep(Duration::from_millis(100));
sleep(Duration::from_millis(250));
if start_wait.elapsed().as_secs() > 1 {
if start_wait.elapsed().as_secs() > 2 {
panic!("timeout waiting for port {port}");
}
}