From b1f9bac21967398f946ae14972ad4ffec707785e Mon Sep 17 00:00:00 2001 From: Pixelstorm Date: Sun, 10 Sep 2023 16:37:29 +0100 Subject: [PATCH] Fix test failure --- src/driver.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/driver.rs b/src/driver.rs index cca3f05..76f23eb 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -179,6 +179,9 @@ pub fn block_on(future: impl Future) -> T { loop { // Poll the future. if let Poll::Ready(t) = future.as_mut().poll(cx) { + // Ensure the cached parker is reset to the unnotified state for future block_on calls, + // in case this future called wake and then immediately returned Poll::Ready. + p.park_timeout(Duration::from_secs(0)); tracing::trace!("completed"); return t; }