We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bbfc694 + 38c5b70 commit 18f4e48Copy full SHA for 18f4e48
lightning-block-sync/src/http.rs
@@ -710,7 +710,13 @@ pub(crate) mod client_tests {
710
711
#[test]
712
fn connect_with_unknown_server() {
713
- match HttpClient::connect(("::", 80)) {
+ // get an unused port by binding to port 0
714
+ let port = {
715
+ let t = std::net::TcpListener::bind(("127.0.0.1", 0)).unwrap();
716
+ t.local_addr().unwrap().port()
717
+ };
718
+
719
+ match HttpClient::connect(("::", port)) {
720
#[cfg(target_os = "windows")]
721
Err(e) => assert_eq!(e.kind(), std::io::ErrorKind::AddrNotAvailable),
722
#[cfg(not(target_os = "windows"))]
0 commit comments