useanyhow::Result;/// Find an available port by binding to a random port (0) and returning the assigned port.
pub async fnfind_available_port()->Result<u16>{usetokio::net::TcpListener;let listener =TcpListener::bind("127.0.0.1:0").await?;let addr = listener.local_addr()?;Ok(addr.port())}