Verified Commit 075b3924 authored by Andronik Ordian's avatar Andronik Ordian
Browse files

util: wait for both subsystem and test_future to finish

parent eac833e4
......@@ -1161,13 +1161,16 @@ mod tests {
futures::pin_mut!(subsystem, test_future, timeout);
executor::block_on(async move {
futures::select! {
_ = test_future.fuse() => (),
_ = subsystem.fuse() => (),
_ = timeout.fuse() => panic!("test timed out instead of completing"),
}
});
futures::executor::block_on(
futures::future::select(
// wait for both to finish
futures::future::join(subsystem, test_future),
timeout,
).then(|either| match either {
futures::future::Either::Right(_) => panic!("test timed out instead of completing"),
futures::future::Either::Left(_) => futures::future::ready(()),
})
);
}
#[test]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment