diff --git a/library/std/src/collections/hash/map/tests.rs b/library/std/src/collections/hash/map/tests.rs index 91a3776e7be84..4f4c8db27654c 100644 --- a/library/std/src/collections/hash/map/tests.rs +++ b/library/std/src/collections/hash/map/tests.rs @@ -269,11 +269,11 @@ fn test_lots_of_insertions() { // Try this a few times to make sure we never screw up the hashmap's // internal state. - let loops = if cfg!(miri) { 2 } else { 10 }; + let loops = if cfg!(miri) || cfg!(target_os = "xous") { 2 } else { 10 }; for _ in 0..loops { assert!(m.is_empty()); - let count = if cfg!(miri) { 101 } else { 1001 }; + let count = if cfg!(miri) || cfg!(target_os = "xous") { 101 } else { 1001 }; for i in 1..count { assert!(m.insert(i, i).is_none()); diff --git a/library/std/src/io/tests.rs b/library/std/src/io/tests.rs index 6d30f5e6c6c8d..777719c2a85c6 100644 --- a/library/std/src/io/tests.rs +++ b/library/std/src/io/tests.rs @@ -309,6 +309,7 @@ fn chain_zero_length_read_is_not_eof() { #[bench] #[cfg_attr(target_os = "emscripten", ignore)] +#[cfg_attr(target_os = "xous", ignore)] #[cfg_attr(miri, ignore)] // Miri isn't fast... fn bench_read_to_end(b: &mut test::Bencher) { b.iter(|| { diff --git a/library/std/src/sync/mpsc/sync_tests.rs b/library/std/src/sync/mpsc/sync_tests.rs index 632709fd98d86..fa04fb5dcc313 100644 --- a/library/std/src/sync/mpsc/sync_tests.rs +++ b/library/std/src/sync/mpsc/sync_tests.rs @@ -122,7 +122,7 @@ fn chan_gone_concurrent() { #[test] fn stress() { - let count = if cfg!(miri) { 100 } else { 10000 }; + let count = if cfg!(miri) || cfg!(target_os = "xous") { 100 } else { 10000 }; let (tx, rx) = sync_channel::(0); thread::spawn(move || { for _ in 0..count { @@ -136,7 +136,7 @@ fn stress() { #[test] fn stress_recv_timeout_two_threads() { - let count = if cfg!(miri) { 100 } else { 10000 }; + let count = if cfg!(miri) || cfg!(target_os = "xous") { 100 } else { 10000 }; let (tx, rx) = sync_channel::(0); thread::spawn(move || { @@ -162,7 +162,7 @@ fn stress_recv_timeout_two_threads() { #[test] fn stress_recv_timeout_shared() { - const AMT: u32 = if cfg!(miri) { 100 } else { 1000 }; + const AMT: u32 = if cfg!(miri) || cfg!(target_os = "xous") { 100 } else { 1000 }; const NTHREADS: u32 = 8; let (tx, rx) = sync_channel::(0); let (dtx, drx) = sync_channel::<()>(0); @@ -202,7 +202,7 @@ fn stress_recv_timeout_shared() { #[test] fn stress_shared() { - const AMT: u32 = if cfg!(miri) { 100 } else { 1000 }; + const AMT: u32 = if cfg!(miri) || cfg!(target_os = "xous") { 100 } else { 1000 }; const NTHREADS: u32 = 8; let (tx, rx) = sync_channel::(0); let (dtx, drx) = sync_channel::<()>(0); @@ -449,7 +449,7 @@ fn stream_send_recv_stress() { #[test] fn recv_a_lot() { - let count = if cfg!(miri) { 1000 } else { 10000 }; + let count = if cfg!(miri) || cfg!(target_os = "xous") { 1000 } else { 10000 }; // Regression test that we don't run out of stack in scheduler context let (tx, rx) = sync_channel(count); for _ in 0..count { @@ -463,7 +463,7 @@ fn recv_a_lot() { #[test] fn shared_chan_stress() { let (tx, rx) = sync_channel(0); - let total = stress_factor() + 100; + let total = stress_factor() + if cfg!(target_os = "xous") { 20 } else { 100 }; for _ in 0..total { let tx = tx.clone(); thread::spawn(move || { diff --git a/library/std/src/sync/mpsc/tests.rs b/library/std/src/sync/mpsc/tests.rs index 1e52a4a705c98..8e5a1d0c5da4a 100644 --- a/library/std/src/sync/mpsc/tests.rs +++ b/library/std/src/sync/mpsc/tests.rs @@ -467,7 +467,7 @@ fn recv_timeout_upgrade() { #[test] fn stress_recv_timeout_shared() { let (tx, rx) = channel(); - let stress = stress_factor() + 100; + let stress = stress_factor() + if cfg!(target_os = "xous") { 10 } else { 100 }; for i in 0..stress { let tx = tx.clone(); @@ -539,7 +539,7 @@ fn shared_recv_timeout() { #[test] fn shared_chan_stress() { let (tx, rx) = channel(); - let total = stress_factor() + 100; + let total = stress_factor() + if cfg!(target_os = "xous") { 20 } else { 100 }; for _ in 0..total { let tx = tx.clone(); thread::spawn(move || { diff --git a/library/std/src/time/tests.rs b/library/std/src/time/tests.rs index 6ed84806e6d37..af247b74cf0e6 100644 --- a/library/std/src/time/tests.rs +++ b/library/std/src/time/tests.rs @@ -32,7 +32,7 @@ fn instant_monotonic_concurrent() -> crate::thread::Result<()> { .map(|_| { crate::thread::spawn(|| { let mut old = Instant::now(); - let count = if cfg!(miri) { 1_000 } else { 5_000_000 }; + let count = if cfg!(miri) || cfg!(target_os = "xous") { 1_000 } else { 5_000_000 }; for _ in 0..count { let new = Instant::now(); assert!(new >= old);