Rollup merge of #59018 - alexcrichton:omg, r=sfackler

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 #52590
This commit is contained in:
Mazdak Farrokhzad 2019-03-09 17:18:27 +01:00 committed by GitHub
commit 02c9928f44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();