mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-20 00:00:08 +02:00
Add an explicit wait for the test to finish (#445)
This commit is contained in:
committed by
Carl Lerche
parent
0440343a11
commit
3fecd0154c
@@ -63,15 +63,20 @@ fn read_write() {
|
||||
|
||||
assert_eq!(dst, contents);
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
pool.spawn({
|
||||
File::open(file_path)
|
||||
.and_then(|file| io::read_to_end(file, vec![]))
|
||||
.then(move |res| {
|
||||
let (_, buf) = res.unwrap();
|
||||
assert_eq!(buf, contents);
|
||||
tx.send(()).unwrap();
|
||||
Ok(())
|
||||
})
|
||||
});
|
||||
|
||||
rx.wait().unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user