Skip to content

Commit

Permalink
test(server): try to fix windows keep-alive test
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Dec 14, 2017
1 parent fe82cea commit be7ca04
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,15 +623,17 @@ fn disable_keep_alive_post_request() {

tx1.send(()).unwrap();

let nread = req.read(&mut buf).unwrap();
// allow a little more time for TCP to notice the FIN
req.set_read_timeout(Some(Duration::from_secs(5))).expect("set_read_timeout 2");
let nread = req.read(&mut buf).expect("keep-alive reading");
assert_eq!(nread, 0);
});

let fut = listener.incoming()
.into_future()
.map_err(|_| unreachable!())
.and_then(|(item, _incoming)| {
let (socket, _) = item.unwrap();
let (socket, _) = item.expect("accepted socket");
Http::<hyper::Chunk>::new().serve_connection(socket, HelloWorld)
.select2(rx1)
.then(|r| {
Expand Down

0 comments on commit be7ca04

Please sign in to comment.