Add an explicit wait for the test to finish (#445)

This commit is contained in:
Laurențiu Nicola
2018-06-22 14:07:02 -07:00
committed by Carl Lerche
parent 0440343a11
commit 3fecd0154c
+5
View File
@@ -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]