diff --git a/crates/wasi/src/preview2/pipe.rs b/crates/wasi/src/preview2/pipe.rs index d4878b3b4df7..9214e50d867f 100644 --- a/crates/wasi/src/preview2/pipe.rs +++ b/crates/wasi/src/preview2/pipe.rs @@ -467,35 +467,33 @@ impl HostOutputStream for ClosedOutputStream { #[cfg(test)] mod test { use super::*; + use std::time::Duration; use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt}; // This is a gross way to handle CI running under qemu for non-x86 architectures. #[cfg(not(target_arch = "x86_64"))] const TEST_ITERATIONS: usize = 10; - // This is a gross way to handle CI running under qemu for non-x86 architectures. - #[cfg(not(target_arch = "x86_64"))] - const REASONABLE_DURATION: std::time::Duration = std::time::Duration::from_millis(200); - #[cfg(target_arch = "x86_64")] const TEST_ITERATIONS: usize = 100; - #[cfg(target_arch = "x86_64")] - const REASONABLE_DURATION: std::time::Duration = std::time::Duration::from_millis(10); - async fn resolves_immediately(fut: F) -> O where F: futures::Future, { - tokio::time::timeout(REASONABLE_DURATION, fut) + // The input `fut` should resolve immediately, but in case it + // accidentally doesn't don't hang the test indefinitely. Provide a + // generous timeout to account for CI sensitivity and various systems. + tokio::time::timeout(Duration::from_secs(2), fut) .await .expect("operation timed out") } - // TODO: is there a way to get tokio to warp through timeouts when it knows nothing is - // happening? async fn never_resolves(fut: F) { - tokio::time::timeout(REASONABLE_DURATION, fut) + // The input `fut` should never resolve, so only give it a small window + // of budget before we time out. If `fut` is actually resolved this + // should show up as a flaky test. + tokio::time::timeout(Duration::from_millis(10), fut) .await .err() .expect("operation should time out"); diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index ed41adbe96c1..85782e2ce15a 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -3248,6 +3248,12 @@ user-id = 1 # Alex Crichton (alexcrichton) start = "2019-03-04" end = "2024-07-14" +[[trusted.wasmtime-wmemcheck]] +criteria = "safe-to-deploy" +user-id = 73222 # wasmtime-publish +start = "2023-09-20" +end = "2024-10-25" + [[trusted.winapi-util]] criteria = "safe-to-deploy" user-id = 189 # Andrew Gallant (BurntSushi) diff --git a/supply-chain/config.toml b/supply-chain/config.toml index 28b251f7ac1d..429251b49472 100644 --- a/supply-chain/config.toml +++ b/supply-chain/config.toml @@ -169,6 +169,9 @@ audit-as-crates-io = true [policy.wasmtime-wit-bindgen] audit-as-crates-io = true +[policy.wasmtime-wmemcheck] +audit-as-crates-io = true + [policy.wiggle] audit-as-crates-io = true diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock index 4d6251cb63ab..112a34be68b5 100644 --- a/supply-chain/imports.lock +++ b/supply-chain/imports.lock @@ -1132,6 +1132,12 @@ when = "2023-07-24" user-id = 73222 user-login = "wasmtime-publish" +[[publisher.wasmtime-wmemcheck]] +version = "13.0.0" +when = "2023-09-20" +user-id = 73222 +user-login = "wasmtime-publish" + [[publisher.wast]] version = "62.0.1" when = "2023-07-26"