File tree Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -10,18 +10,22 @@ use std::time::Duration;
1010
1111fn do_run < Fut : Future < Output = ( ) > > ( mut f : impl FnMut ( Arc < Executor < ' static > > ) -> Fut ) {
1212 // This should not run for longer than two minutes.
13- let ( _stop_timeout, stopper) = async_channel:: bounded :: < ( ) > ( 1 ) ;
14- thread:: spawn ( move || {
15- block_on ( async move {
16- let timeout = async {
17- async_io:: Timer :: after ( Duration :: from_secs ( 2 * 60 ) ) . await ;
18- eprintln ! ( "test timed out after 2m" ) ;
19- std:: process:: exit ( 1 )
20- } ;
21-
22- let _ = stopper. recv ( ) . or ( timeout) . await ;
23- } )
24- } ) ;
13+ #[ cfg( not( miri) ) ]
14+ let _stop_timeout = {
15+ let ( stop_timeout, stopper) = async_channel:: bounded :: < ( ) > ( 1 ) ;
16+ thread:: spawn ( move || {
17+ block_on ( async move {
18+ let timeout = async {
19+ async_io:: Timer :: after ( Duration :: from_secs ( 2 * 60 ) ) . await ;
20+ eprintln ! ( "test timed out after 2m" ) ;
21+ std:: process:: exit ( 1 )
22+ } ;
23+
24+ let _ = stopper. recv ( ) . or ( timeout) . await ;
25+ } )
26+ } ) ;
27+ stop_timeout
28+ } ;
2529
2630 let ex = Arc :: new ( Executor :: new ( ) ) ;
2731
You can’t perform that action at this time.
0 commit comments