@@ -200,10 +200,7 @@ fn tx_close_gets_none() {
200200
201201#[ test]
202202fn stress_shared_unbounded ( ) {
203- #[ cfg( miri) ]
204- const AMT : u32 = 100 ;
205- #[ cfg( not( miri) ) ]
206- const AMT : u32 = 10000 ;
203+ const AMT : u32 = if cfg ! ( miri) { 100 } else { 10000 } ;
207204 const NTHREADS : u32 = 8 ;
208205 let ( tx, rx) = mpsc:: unbounded :: < i32 > ( ) ;
209206
@@ -232,10 +229,7 @@ fn stress_shared_unbounded() {
232229
233230#[ test]
234231fn stress_shared_bounded_hard ( ) {
235- #[ cfg( miri) ]
236- const AMT : u32 = 100 ;
237- #[ cfg( not( miri) ) ]
238- const AMT : u32 = 10000 ;
232+ const AMT : u32 = if cfg ! ( miri) { 100 } else { 10000 } ;
239233 const NTHREADS : u32 = 8 ;
240234 let ( tx, rx) = mpsc:: channel :: < i32 > ( 0 ) ;
241235
@@ -265,10 +259,7 @@ fn stress_shared_bounded_hard() {
265259#[ allow( clippy:: same_item_push) ]
266260#[ test]
267261fn stress_receiver_multi_task_bounded_hard ( ) {
268- #[ cfg( miri) ]
269- const AMT : usize = 100 ;
270- #[ cfg( not( miri) ) ]
271- const AMT : usize = 10_000 ;
262+ const AMT : usize = if cfg ! ( miri) { 100 } else { 10_000 } ;
272263 const NTHREADS : u32 = 2 ;
273264
274265 let ( mut tx, rx) = mpsc:: channel :: < usize > ( 0 ) ;
@@ -336,10 +327,7 @@ fn stress_receiver_multi_task_bounded_hard() {
336327/// after sender dropped.
337328#[ test]
338329fn stress_drop_sender ( ) {
339- #[ cfg( miri) ]
340- const ITER : usize = 100 ;
341- #[ cfg( not( miri) ) ]
342- const ITER : usize = 10000 ;
330+ const ITER : usize = if cfg ! ( miri) { 100 } else { 10000 } ;
343331
344332 fn list ( ) -> impl Stream < Item = i32 > {
345333 let ( tx, rx) = mpsc:: channel ( 1 ) ;
@@ -394,10 +382,9 @@ fn stress_close_receiver_iter() {
394382 }
395383}
396384
397- #[ cfg_attr( miri, ignore) ] // Miri is too slow
398385#[ test]
399386fn stress_close_receiver ( ) {
400- const ITER : usize = 10000 ;
387+ const ITER : usize = if cfg ! ( miri ) { 50 } else { 10000 } ;
401388
402389 for _ in 0 ..ITER {
403390 stress_close_receiver_iter ( ) ;
@@ -414,10 +401,7 @@ async fn stress_poll_ready_sender(mut sender: mpsc::Sender<u32>, count: u32) {
414401#[ allow( clippy:: same_item_push) ]
415402#[ test]
416403fn stress_poll_ready ( ) {
417- #[ cfg( miri) ]
418- const AMT : u32 = 100 ;
419- #[ cfg( not( miri) ) ]
420- const AMT : u32 = 1000 ;
404+ const AMT : u32 = if cfg ! ( miri) { 100 } else { 1000 } ;
421405 const NTHREADS : u32 = 8 ;
422406
423407 /// Run a stress test using the specified channel capacity.
@@ -444,10 +428,9 @@ fn stress_poll_ready() {
444428 stress ( 16 ) ;
445429}
446430
447- #[ cfg_attr( miri, ignore) ] // Miri is too slow
448431#[ test]
449432fn try_send_1 ( ) {
450- const N : usize = 3000 ;
433+ const N : usize = if cfg ! ( miri ) { 100 } else { 3000 } ;
451434 let ( mut tx, rx) = mpsc:: channel ( 0 ) ;
452435
453436 let t = thread:: spawn ( move || {
0 commit comments