Skip to content

Commit

Permalink
Make test harness connection shutdown a little cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfairley committed Dec 11, 2018
1 parent 282f4c9 commit 39bd742
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,11 +548,9 @@ fn send_lines(
.forward(out)
.map(|(_source, sink)| sink)
.and_then(|sink| {
// This waits for FIN from the server so we don't start shutting it down before it's fully received the test data
let socket = sink.into_inner().into_inner();
socket.shutdown(std::net::Shutdown::Write).unwrap();
FramedRead::new(socket, BytesCodec::new())
.for_each(|_| Ok(()))
tokio::io::shutdown(socket)
.map(|_| ())
.map_err(|e| panic!("{:}", e))
})
})
Expand Down
6 changes: 2 additions & 4 deletions tests/basic_tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,9 @@ fn send_lines(
.forward(out)
.map(|(_source, sink)| sink)
.and_then(|sink| {
// This waits for FIN from the server so we don't start shutting it down before it's fully received the test data
let socket = sink.into_inner().into_inner();
socket.shutdown(std::net::Shutdown::Write).unwrap();
FramedRead::new(socket, BytesCodec::new())
.for_each(|_| Ok(()))
tokio::io::shutdown(socket)
.map(|_| ())
.map_err(|e| panic!("{:}", e))
})
})
Expand Down

0 comments on commit 39bd742

Please sign in to comment.