chore: Fix MIRI failure in larger_tasks
Signed-off-by: John Nunley <dev@notgull.net>
This commit is contained in:
parent
a2c1267c85
commit
b6d3a60b44
|
@ -10,18 +10,22 @@ use std::time::Duration;
|
||||||
|
|
||||||
fn do_run<Fut: Future<Output = ()>>(mut f: impl FnMut(Arc<Executor<'static>>) -> Fut) {
|
fn do_run<Fut: Future<Output = ()>>(mut f: impl FnMut(Arc<Executor<'static>>) -> Fut) {
|
||||||
// This should not run for longer than two minutes.
|
// This should not run for longer than two minutes.
|
||||||
let (_stop_timeout, stopper) = async_channel::bounded::<()>(1);
|
#[cfg(not(miri))]
|
||||||
thread::spawn(move || {
|
let _stop_timeout = {
|
||||||
block_on(async move {
|
let (stop_timeout, stopper) = async_channel::bounded::<()>(1);
|
||||||
let timeout = async {
|
thread::spawn(move || {
|
||||||
async_io::Timer::after(Duration::from_secs(2 * 60)).await;
|
block_on(async move {
|
||||||
eprintln!("test timed out after 2m");
|
let timeout = async {
|
||||||
std::process::exit(1)
|
async_io::Timer::after(Duration::from_secs(2 * 60)).await;
|
||||||
};
|
eprintln!("test timed out after 2m");
|
||||||
|
std::process::exit(1)
|
||||||
|
};
|
||||||
|
|
||||||
let _ = stopper.recv().or(timeout).await;
|
let _ = stopper.recv().or(timeout).await;
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
stop_timeout
|
||||||
|
};
|
||||||
|
|
||||||
let ex = Arc::new(Executor::new());
|
let ex = Arc::new(Executor::new());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue