Skip to content

Commit 4bf6bfa

Browse files
committed
---
yaml --- r: 214875 b: refs/heads/beta c: b5c6c7e h: refs/heads/master i: 214873: 34aaf76 214871: ac26a07 v: v3
1 parent f2d8bc2 commit 4bf6bfa

File tree

3 files changed

+13
-21
lines changed

3 files changed

+13
-21
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 494901a8b46c699b530e7209114bde44b1de4451
26+
refs/heads/beta: b5c6c7ed408c1c7afb8d4f0430f67255a140d183
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 8c0aa6d64ebab528f7eb182812007155d6044972
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/libstd/net/tcp.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -933,17 +933,15 @@ mod tests {
933933
let listener = t!(TcpListener::bind(&addr));
934934

935935
let mut stream = t!(TcpStream::connect(&("localhost", addr.port())));
936-
t!(stream.set_read_timeout(Some(Duration::from_millis(10))));
936+
t!(stream.set_read_timeout(Some(Duration::from_millis(1000))));
937937

938938
let mut buf = [0; 10];
939939
let wait = Duration::span(|| {
940940
let kind = stream.read(&mut buf).err().expect("expected error").kind();
941941
assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut);
942942
});
943-
assert!(wait > Duration::from_millis(5));
944-
// windows will sometimes extend this by ~500ms, so we'll just take the
945-
// fact that we did time out as a win :(
946-
assert!(cfg!(windows) || wait < Duration::from_millis(15));
943+
assert!(wait > Duration::from_millis(400));
944+
assert!(wait < Duration::from_millis(1600));
947945
}
948946

949947
#[test]
@@ -952,7 +950,7 @@ mod tests {
952950
let listener = t!(TcpListener::bind(&addr));
953951

954952
let mut stream = t!(TcpStream::connect(&("localhost", addr.port())));
955-
t!(stream.set_read_timeout(Some(Duration::from_millis(10))));
953+
t!(stream.set_read_timeout(Some(Duration::from_millis(1000))));
956954

957955
let mut other_end = t!(listener.accept()).0;
958956
t!(other_end.write_all(b"hello world"));
@@ -965,9 +963,7 @@ mod tests {
965963
let kind = stream.read(&mut buf).err().expect("expected error").kind();
966964
assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut);
967965
});
968-
assert!(wait > Duration::from_millis(5));
969-
// windows will sometimes extend this by ~500ms, so we'll just take the
970-
// fact that we did time out as a win :(
971-
assert!(cfg!(windows) || wait < Duration::from_millis(15));
966+
assert!(wait > Duration::from_millis(400));
967+
assert!(wait < Duration::from_millis(1600));
972968
}
973969
}

branches/beta/src/libstd/net/udp.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -389,25 +389,23 @@ mod tests {
389389
let addr = next_test_ip4();
390390

391391
let mut stream = t!(UdpSocket::bind(&addr));
392-
t!(stream.set_read_timeout(Some(Duration::from_millis(10))));
392+
t!(stream.set_read_timeout(Some(Duration::from_millis(1000))));
393393

394394
let mut buf = [0; 10];
395395
let wait = Duration::span(|| {
396396
let kind = stream.recv_from(&mut buf).err().expect("expected error").kind();
397397
assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut);
398398
});
399-
assert!(wait > Duration::from_millis(5));
400-
// windows will sometimes extend this by ~500ms, so we'll just take the
401-
// fact that we did time out as a win :(
402-
assert!(cfg!(windows) || wait < Duration::from_millis(15));
399+
assert!(wait > Duration::from_millis(400));
400+
assert!(wait < Duration::from_millis(1600));
403401
}
404402

405403
#[test]
406404
fn test_read_with_timeout() {
407405
let addr = next_test_ip4();
408406

409407
let mut stream = t!(UdpSocket::bind(&addr));
410-
t!(stream.set_read_timeout(Some(Duration::from_millis(10))));
408+
t!(stream.set_read_timeout(Some(Duration::from_millis(1000))));
411409

412410
t!(stream.send_to(b"hello world", &addr));
413411

@@ -419,9 +417,7 @@ mod tests {
419417
let kind = stream.recv_from(&mut buf).err().expect("expected error").kind();
420418
assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut);
421419
});
422-
assert!(wait > Duration::from_millis(5));
423-
// windows will sometimes extend this by ~500ms, so we'll just take the
424-
// fact that we did time out as a win :(
425-
assert!(cfg!(windows) || wait < Duration::from_millis(15));
420+
assert!(wait > Duration::from_millis(400));
421+
assert!(wait < Duration::from_millis(1600));
426422
}
427423
}

0 commit comments

Comments
 (0)