Skip to content

Commit

Permalink
Rollup merge of rust-lang#59018 - alexcrichton:omg, r=sfackler
Browse files Browse the repository at this point in the history
std: Delete a by-definition spuriously failing test

This commit deletes the `connect_timeout_unbound` test from the standard
library which, unfortunately, is by definition eventually going to be a
spuriously failing test. There's no way to reserve a port as unbound so
we can rely on ecosystem testing for this feature for now.

Closes rust-lang#52590
  • Loading branch information
Centril authored Mar 9, 2019
2 parents f67efe9 + 6465257 commit 02c9928
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/libstd/net/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1742,21 +1742,6 @@ mod tests {
})
}

#[test]
fn connect_timeout_unbound() {
// bind and drop a socket to track down a "probably unassigned" port
let socket = TcpListener::bind("127.0.0.1:0").unwrap();
let addr = socket.local_addr().unwrap();
drop(socket);

let timeout = Duration::from_secs(1);
let e = TcpStream::connect_timeout(&addr, timeout).unwrap_err();
assert!(e.kind() == io::ErrorKind::ConnectionRefused ||
e.kind() == io::ErrorKind::TimedOut ||
e.kind() == io::ErrorKind::Other,
"bad error: {} {:?}", e, e.kind());
}

#[test]
fn connect_timeout_valid() {
let listener = TcpListener::bind("127.0.0.1:0").unwrap();
Expand Down

0 comments on commit 02c9928

Please sign in to comment.