update tests

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2019-12-13 12:33:49 +01:00
parent b5c9a706ce
commit f374ba4c0b
2 changed files with 6 additions and 5 deletions

View File

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

View File

@ -39,7 +39,7 @@ fn worker_task_abort() -> Result<(), Error> {
let errmsg: Arc<Mutex<Option<String>>> = Arc::new(Mutex::new(None));
let errmsg1 = errmsg.clone();
let rt = tokio::runtime::Runtime::new().unwrap();
let mut rt = tokio::runtime::Runtime::new().unwrap();
rt.block_on(async move {
let init_result: Result<(), Error> = try_block!({
@ -80,7 +80,6 @@ fn worker_task_abort() -> Result<(), Error> {
}
}
});
rt.shutdown_on_idle();
let data = errmsg.lock().unwrap();
match *data {