Rollup merge of #77918 - wcampbell0x2a:cleanup-network-tests, r=m-ou-se

Cleanup network tests

Some cleanup for network related tests
This commit is contained in:
Yuki Okushi 2020-10-23 18:26:22 +09:00 committed by GitHub
commit b968738348
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 12 deletions

View File

@ -73,10 +73,9 @@ pub fn got_symlink_permission(tmpdir: &TempDir) -> bool {
let link = tmpdir.join("some_hopefully_unique_link_name");
match symlink_file(r"nonexisting_target", link) {
Ok(_) => true,
// ERROR_PRIVILEGE_NOT_HELD = 1314
Err(ref err) if err.raw_os_error() == Some(1314) => false,
Err(_) => true,
Ok(_) | Err(_) => true,
}
}

View File

@ -152,19 +152,13 @@ fn udp_clone_two_write() {
let (done, rx) = channel();
let tx2 = tx.clone();
let _t = thread::spawn(move || {
match sock3.send_to(&[1], &addr2) {
Ok(..) => {
let _ = tx2.send(());
}
Err(..) => {}
if sock3.send_to(&[1], &addr2).is_ok() {
let _ = tx2.send(());
}
done.send(()).unwrap();
});
match sock1.send_to(&[2], &addr2) {
Ok(..) => {
let _ = tx.send(());
}
Err(..) => {}
if sock1.send_to(&[2], &addr2).is_ok() {
let _ = tx.send(());
}
drop(tx);