From c80915e216de0c8820a8d58efda04b98b07a38c3 Mon Sep 17 00:00:00 2001 From: Oleg Nosov Date: Fri, 7 Feb 2020 22:22:38 +0300 Subject: [PATCH] Dont spawn thread in tests --- tests/stream.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/stream.rs b/tests/stream.rs index 75c1b10c..fec14665 100644 --- a/tests/stream.rs +++ b/tests/stream.rs @@ -144,12 +144,8 @@ fn flat_map_doesnt_poll_completed_inner_stream() { fn poll_next(mut self: Pin<&mut Self>, ctx: &mut Context) -> Poll> { if self.polled { - let waker = ctx.waker().clone(); - std::thread::spawn(move || { - std::thread::sleep(std::time::Duration::from_millis(10)); - waker.wake_by_ref(); - }); self.polled = false; + ctx.waker().wake_by_ref(); Poll::Pending } else { self.polled = true;