mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +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);
|
assert_eq!(dst, contents);
|
||||||
|
|
||||||
|
let (tx, rx) = oneshot::channel();
|
||||||
|
|
||||||
pool.spawn({
|
pool.spawn({
|
||||||
File::open(file_path)
|
File::open(file_path)
|
||||||
.and_then(|file| io::read_to_end(file, vec![]))
|
.and_then(|file| io::read_to_end(file, vec![]))
|
||||||
.then(move |res| {
|
.then(move |res| {
|
||||||
let (_, buf) = res.unwrap();
|
let (_, buf) = res.unwrap();
|
||||||
assert_eq!(buf, contents);
|
assert_eq!(buf, contents);
|
||||||
|
tx.send(()).unwrap();
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
rx.wait().unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user