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 { ...@@ -1161,13 +1161,16 @@ mod tests {
futures::pin_mut!(subsystem, test_future, timeout); futures::pin_mut!(subsystem, test_future, timeout);
executor::block_on(async move { futures::executor::block_on(
futures::select! { futures::future::select(
_ = test_future.fuse() => (), // wait for both to finish
_ = subsystem.fuse() => (), futures::future::join(subsystem, test_future),
_ = timeout.fuse() => panic!("test timed out instead of completing"), timeout,
} ).then(|either| match either {
}); futures::future::Either::Right(_) => panic!("test timed out instead of completing"),
futures::future::Either::Left(_) => futures::future::ready(()),
})
);
} }
#[test] #[test]
...@@ -1229,7 +1232,7 @@ mod tests { ...@@ -1229,7 +1232,7 @@ mod tests {
test_harness(run_args, |mut overseer_handle, err_rx| async move { test_harness(run_args, |mut overseer_handle, err_rx| async move {
// send to a non running job // send to a non running job
overseer_handle overseer_handle
.send(FromOverseer::Communication { .send(FromOverseer::Communication {
msg: Default::default(), msg: Default::default(),
}) })
.await; .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