fix broadcast_future test case

We used to await all the futures via the runtime's shutdown
method, which doesn't exist anymore, so await all the join
handles instead.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2019-12-17 10:47:11 +01:00
parent ba3eb88d95
commit 8554ac5ec3
1 changed files with 4 additions and 5 deletions

View File

@ -159,15 +159,14 @@ fn test_broadcast_future() {
.map_err(|err| { panic!("got errror {}", err); })
.map(|_| ());
let receiver_finish = sender.listen();
let mut rt = tokio::runtime::Runtime::new().unwrap();
rt.block_on(async move {
tokio::spawn(receiver1);
tokio::spawn(receiver2);
let r1 = tokio::spawn(receiver1);
let r2 = tokio::spawn(receiver2);
trigger.send(Ok(1)).unwrap();
let _ = receiver_finish.await;
let _ = r1.await;
let _ = r2.await;
});
let result = CHECKSUM.load(Ordering::SeqCst);