chore: Fix MIRI failure in larger_tasks

Signed-off-by: John Nunley <dev@notgull.net>
This commit is contained in:
John Nunley 2024-03-23 16:26:19 -07:00 committed by John Nunley
parent a2c1267c85
commit b6d3a60b44
1 changed files with 15 additions and 11 deletions

View File

@ -10,7 +10,9 @@ use std::time::Duration;
fn do_run<Fut: Future<Output = ()>>(mut f: impl FnMut(Arc<Executor<'static>>) -> Fut) {
// This should not run for longer than two minutes.
let (_stop_timeout, stopper) = async_channel::bounded::<()>(1);
#[cfg(not(miri))]
let _stop_timeout = {
let (stop_timeout, stopper) = async_channel::bounded::<()>(1);
thread::spawn(move || {
block_on(async move {
let timeout = async {
@ -22,6 +24,8 @@ fn do_run<Fut: Future<Output = ()>>(mut f: impl FnMut(Arc<Executor<'static>>) ->
let _ = stopper.recv().or(timeout).await;
})
});
stop_timeout
};
let ex = Arc::new(Executor::new());