You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An example test which will fail (or more accurately: block infinitely)
#[test]fnfutures_do_not_block(){let(tx, rx) = multiqueue::broadcast_fut_queue::<i32>(16);letmut rt = tokio::runtime::Runtime::new().unwrap();
rt.block_on(
rx
.for_each(|_| {
futures::future::ok(())}).into_future().timeout(Duration::from_millis(100)).then(|result| {match result {Ok(_) => Err("this never has a change to even come up - the above blocks forever"),Err(_) => Ok("timed out as expected"),}})).unwrap();}
This test will hang because this loop has a case in which it'll keep spinning on the recv attempt and never returns control to the event loop.
As such the timeout never has a chance to be considered reached and the future never resolves even with the timeout on it.
The text was updated successfully, but these errors were encountered:
An example test which will fail (or more accurately: block infinitely)
This test will hang because this loop has a case in which it'll keep spinning on the recv attempt and never returns control to the event loop.
As such the timeout never has a chance to be considered reached and the future never resolves even with the timeout on it.
The text was updated successfully, but these errors were encountered: