aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_bytes.rs7
-rw-r--r--tests/test_bytes_odd_alloc.rs2
2 files changed, 6 insertions, 3 deletions
diff --git a/tests/test_bytes.rs b/tests/test_bytes.rs
index 78be4b7..b9e6ce4 100644
--- a/tests/test_bytes.rs
+++ b/tests/test_bytes.rs
@@ -461,6 +461,7 @@ fn reserve_allocates_at_least_original_capacity() {
}
#[test]
+#[cfg_attr(miri, ignore)] // Miri is too slow
fn reserve_max_original_capacity_value() {
const SIZE: usize = 128 * 1024;
@@ -608,15 +609,15 @@ fn advance_past_len() {
#[test]
// Only run these tests on little endian systems. CI uses qemu for testing
-// little endian... and qemu doesn't really support threading all that well.
-#[cfg(target_endian = "little")]
+// big endian... and qemu doesn't really support threading all that well.
+#[cfg(any(miri, target_endian = "little"))]
fn stress() {
// Tests promoting a buffer from a vec -> shared in a concurrent situation
use std::sync::{Arc, Barrier};
use std::thread;
const THREADS: usize = 8;
- const ITERS: usize = 1_000;
+ const ITERS: usize = if cfg!(miri) { 100 } else { 1_000 };
for i in 0..ITERS {
let data = [i as u8; 256];
diff --git a/tests/test_bytes_odd_alloc.rs b/tests/test_bytes_odd_alloc.rs
index 4ce424b..04ba7c2 100644
--- a/tests/test_bytes_odd_alloc.rs
+++ b/tests/test_bytes_odd_alloc.rs
@@ -1,6 +1,8 @@
//! Test using `Bytes` with an allocator that hands out "odd" pointers for
//! vectors (pointers where the LSB is set).
+#![cfg(not(miri))] // Miri does not support custom allocators (also, Miri is "odd" by default with 50% chance)
+
use std::alloc::{GlobalAlloc, Layout, System};
use std::ptr;