From 08bb8b3d53eb2445de9b5e2845ab8acf9d353800 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sat, 10 Oct 2020 05:41:11 -0400 Subject: Fix 100% CPU idling problem by reverting #7672 (#7911) * Revert "refactor: Worker is not a Future (#7895)" This reverts commit f4357f0ff9d39411f22504fcc20db6bd5dec6ddb. * Revert "refactor(core): JsRuntime is not a Future (#7855)" This reverts commit d8879feb8c832dbb38649551b1cb0730874f7be6. * Revert "fix(core): module execution with top level await (#7672)" This reverts commit c7c767782538243ded64742dca9b34d6af74d62d. --- op_crates/web/lib.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'op_crates/web/lib.rs') diff --git a/op_crates/web/lib.rs b/op_crates/web/lib.rs index eaf7e9f14..26e36365b 100644 --- a/op_crates/web/lib.rs +++ b/op_crates/web/lib.rs @@ -75,6 +75,7 @@ pub fn get_declaration() -> PathBuf { mod tests { use deno_core::JsRuntime; use futures::future::lazy; + use futures::future::FutureExt; use futures::task::Context; use futures::task::Poll; @@ -101,7 +102,7 @@ mod tests { include_str!("abort_controller_test.js"), ) .unwrap(); - if let Poll::Ready(Err(_)) = isolate.poll_event_loop(&mut cx) { + if let Poll::Ready(Err(_)) = isolate.poll_unpin(&mut cx) { unreachable!(); } }); @@ -114,7 +115,7 @@ mod tests { isolate .execute("event_test.js", include_str!("event_test.js")) .unwrap(); - if let Poll::Ready(Err(_)) = isolate.poll_event_loop(&mut cx) { + if let Poll::Ready(Err(_)) = isolate.poll_unpin(&mut cx) { unreachable!(); } }); @@ -133,7 +134,7 @@ mod tests { } else { unreachable!(); } - if let Poll::Ready(Err(_)) = isolate.poll_event_loop(&mut cx) { + if let Poll::Ready(Err(_)) = isolate.poll_unpin(&mut cx) { unreachable!(); } }); @@ -146,7 +147,7 @@ mod tests { isolate .execute("event_target_test.js", include_str!("event_target_test.js")) .unwrap(); - if let Poll::Ready(Err(_)) = isolate.poll_event_loop(&mut cx) { + if let Poll::Ready(Err(_)) = isolate.poll_unpin(&mut cx) { unreachable!(); } }); @@ -162,7 +163,7 @@ mod tests { include_str!("text_encoding_test.js"), ) .unwrap(); - if let Poll::Ready(Err(_)) = isolate.poll_event_loop(&mut cx) { + if let Poll::Ready(Err(_)) = isolate.poll_unpin(&mut cx) { unreachable!(); } }); -- cgit v1.2.3