From 8554ac5ec327eebf27eb33f57a0ffa15403638a4 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 17 Dec 2019 10:47:11 +0100 Subject: [PATCH] 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 --- src/tools/broadcast_future.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/tools/broadcast_future.rs b/src/tools/broadcast_future.rs index 79653339..8a15bd65 100644 --- a/src/tools/broadcast_future.rs +++ b/src/tools/broadcast_future.rs @@ -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);