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]
......@@ -1229,7 +1232,7 @@ mod tests {
test_harness(run_args, |mut overseer_handle, err_rx| async move {
// send to a non running job
overseer_handle
.send(FromOverseer::Communication {
.send(FromOverseer::Communication {
msg: Default::default(),
})
.await;
......
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