@@ -648,6 +648,7 @@ mod tests {
648648 }
649649
650650 mod select_candidates {
651+ use futures_timer:: Delay ;
651652 use super :: super :: * ;
652653 use super :: { build_occupied_core, default_bitvec, occupied_core, scheduled_core} ;
653654 use polkadot_node_subsystem:: messages:: RuntimeApiRequest :: {
@@ -675,9 +676,7 @@ mod tests {
675676
676677 futures:: pin_mut!( overseer, test) ;
677678
678- tokio:: runtime:: Runtime :: new ( )
679- . unwrap ( )
680- . block_on ( future:: select ( overseer, test) ) ;
679+ futures:: executor:: block_on ( future:: select ( overseer, test) ) ;
681680 }
682681
683682 // For test purposes, we always return this set of availability cores:
@@ -784,12 +783,12 @@ mod tests {
784783 // drop the receiver so it closes and the sender can't send, then just sleep long enough that
785784 // this is almost certainly not the first of the two futures to complete
786785 std:: mem:: drop ( rx) ;
787- tokio :: time :: delay_for ( std:: time:: Duration :: from_secs ( 1 ) ) . await ;
786+ Delay :: new ( std:: time:: Duration :: from_secs ( 1 ) ) . await ;
788787 } ;
789788
790789 let test = |mut tx : mpsc:: Sender < FromJob > | async move {
791790 // wait so that the overseer can drop the rx before we attempt to send
792- tokio :: time :: delay_for ( std:: time:: Duration :: from_millis ( 50 ) ) . await ;
791+ Delay :: new ( std:: time:: Duration :: from_millis ( 50 ) ) . await ;
793792 let result = select_candidates ( & [ ] , & [ ] , & [ ] , Default :: default ( ) , & mut tx) . await ;
794793 println ! ( "{:?}" , result) ;
795794 assert ! ( std:: matches!( result, Err ( Error :: OneshotSend ) ) ) ;
0 commit comments