mirror of https://github.com/fafhrd91/actix-web
fix mac test
This commit is contained in:
parent
bee0a31add
commit
467ecbf75a
|
@ -1450,13 +1450,25 @@ mod tests {
|
||||||
|
|
||||||
stream.shutdown().await.unwrap();
|
stream.shutdown().await.unwrap();
|
||||||
|
|
||||||
actix_rt::time::sleep(Duration::from_secs(3)).await;
|
let start = Instant::now();
|
||||||
actix_rt::task::yield_now().await;
|
let mut interval = actix_rt::time::interval(Duration::from_secs(1));
|
||||||
|
|
||||||
poll_fn(|cx| {
|
loop {
|
||||||
assert!(h1.as_mut().poll(cx).is_ready());
|
let _ = interval.tick().await;
|
||||||
Poll::Ready(())
|
|
||||||
})
|
if start.elapsed() > Duration::from_secs(10) {
|
||||||
.await;
|
panic!("Payload interval pending check failed to shutdown dispatcher");
|
||||||
|
}
|
||||||
|
|
||||||
|
let ready = poll_fn(|cx| {
|
||||||
|
let ready = h1.as_mut().poll(cx).is_ready();
|
||||||
|
Poll::Ready(ready)
|
||||||
|
})
|
||||||
|
.await;
|
||||||
|
|
||||||
|
if ready {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue