From fb549c6ddb7136403f699b6426c90c854f1c97d0 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Fri, 22 Oct 2021 16:12:07 -0700 Subject: [PATCH] actually do some awaiting in the async limiter, which doesnt work something tls-related is not right --- tests/all/limits.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/all/limits.rs b/tests/all/limits.rs index 04cb0f5769..1515197ff9 100644 --- a/tests/all/limits.rs +++ b/tests/all/limits.rs @@ -510,6 +510,8 @@ impl ResourceLimiterAsync for MemoryContext { desired: usize, maximum: Option, ) -> bool { + // Show we can await in this async context: + tokio::time::sleep(std::time::Duration::from_millis(1)).await; // Check if the desired exceeds a maximum (either from Wasm or from the host) assert!(desired < maximum.unwrap_or(usize::MAX)); @@ -808,6 +810,8 @@ impl ResourceLimiterAsync for FailureDetector { desired: usize, _maximum: Option, ) -> bool { + // Show we can await in this async context: + tokio::time::sleep(std::time::Duration::from_millis(1)).await; self.memory_current = current; self.memory_desired = desired; true