diff --git a/tokio-fs/tests/file.rs b/tokio-fs/tests/file.rs index 05e46d299..c8185c1f2 100644 --- a/tokio-fs/tests/file.rs +++ b/tokio-fs/tests/file.rs @@ -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]