diff --git a/crates/test-programs/wasi-tests/src/bin/poll_oneoff_stdio.rs b/crates/test-programs/wasi-tests/src/bin/poll_oneoff_stdio.rs index b5c3bad73e..07ac90b792 100644 --- a/crates/test-programs/wasi-tests/src/bin/poll_oneoff_stdio.rs +++ b/crates/test-programs/wasi-tests/src/bin/poll_oneoff_stdio.rs @@ -2,6 +2,7 @@ use std::collections::HashMap; use std::mem::MaybeUninit; use wasi_tests::{assert_errno, STDERR_FD, STDIN_FD, STDOUT_FD}; +const TIMEOUT: u64 = 20_000_000u64; // 20 milliseconds, required to satisfy slow execution in CI const CLOCK_ID: wasi::Userdata = 0x0123_45678; const STDIN_ID: wasi::Userdata = 0x8765_43210; @@ -18,7 +19,7 @@ unsafe fn poll_oneoff_impl(r#in: &[wasi::Subscription]) -> Result Result<(), Error> { let clocks = clocks_ctx(); @@ -40,7 +42,7 @@ async fn empty_file_readable() -> Result<(), Error> { clocks .monotonic .now(clocks.monotonic.resolution()) - .checked_add(Duration::from_millis(10)) + .checked_add(TIMEOUT) .unwrap(), clocks.monotonic.resolution(), Userdata::from(0), @@ -82,7 +84,7 @@ async fn empty_file_writable() -> Result<(), Error> { clocks .monotonic .now(clocks.monotonic.resolution()) - .checked_add(Duration::from_millis(10)) + .checked_add(TIMEOUT) .unwrap(), clocks.monotonic.resolution(), Userdata::from(0), @@ -109,7 +111,7 @@ async fn stdio_readable() -> Result<(), Error> { let deadline = clocks .monotonic .now(clocks.monotonic.resolution()) - .checked_add(Duration::from_millis(10)) + .checked_add(TIMEOUT) .unwrap(); let mut waiting_on: HashMap> = vec![