Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions crates/wasi/src/preview2/pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<F, O>(fut: F) -> O
where
F: futures::Future<Output = O>,
{
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<F: futures::Future>(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");
Expand Down
6 changes: 6 additions & 0 deletions supply-chain/audits.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions supply-chain/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions supply-chain/imports.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down