diff options
| author | Ralf Jung <post@ralfj.de> | 2022-08-04 09:16:42 -0400 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2022-08-18 18:07:39 -0400 |
| commit | 8c8dc125b1bfca49ac8f064b365cb72a658e7cba (patch) | |
| tree | f3a2f741e3b6573b204fd4074e5fd7f7731c5c5e /library/std/src/sync/mpsc/spsc_queue | |
| parent | 27b044433367d7305f71bcf67dd9b5be0a0bd65a (diff) | |
| download | rust-8c8dc125b1bfca49ac8f064b365cb72a658e7cba.tar.gz rust-8c8dc125b1bfca49ac8f064b365cb72a658e7cba.zip | |
make many std tests work in Miri
Diffstat (limited to 'library/std/src/sync/mpsc/spsc_queue')
| -rw-r--r-- | library/std/src/sync/mpsc/spsc_queue/tests.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/library/std/src/sync/mpsc/spsc_queue/tests.rs b/library/std/src/sync/mpsc/spsc_queue/tests.rs index 467ef3dbdcb..eb6d5c2cf66 100644 --- a/library/std/src/sync/mpsc/spsc_queue/tests.rs +++ b/library/std/src/sync/mpsc/spsc_queue/tests.rs @@ -77,12 +77,13 @@ fn stress() { } unsafe fn stress_bound(bound: usize) { + let count = if cfg!(miri) { 1000 } else { 100000 }; let q = Arc::new(Queue::with_additions(bound, (), ())); let (tx, rx) = channel(); let q2 = q.clone(); let _t = thread::spawn(move || { - for _ in 0..100000 { + for _ in 0..count { loop { match q2.pop() { Some(1) => break, @@ -93,7 +94,7 @@ fn stress() { } tx.send(()).unwrap(); }); - for _ in 0..100000 { + for _ in 0..count { q.push(1); } rx.recv().unwrap(); |
