File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
crates/core/src/subscription Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -325,13 +325,18 @@ mod tests {
325325 timer : None ,
326326 } ) ;
327327
328- let subscriptions = module_subscriptions. subscriptions . read ( ) ;
329- module_subscriptions. blocking_broadcast_event ( Some ( & sender) , & subscriptions, event) ;
330- drop ( subscriptions) ;
328+ runtime. spawn_blocking ( move || {
329+ let subscriptions = module_subscriptions. subscriptions . read ( ) ;
330+ module_subscriptions. blocking_broadcast_event ( Some ( & sender) , & subscriptions, event) ;
331+ } ) ;
331332
332333 runtime. block_on ( async move {
333- rx0. recv ( ) . await . expect ( "Expected at least one message" ) ;
334- rx1. recv ( ) . await . expect ( "Expected at least one message" ) ;
334+ tokio:: time:: timeout ( Duration :: from_millis ( 10 ) , async move {
335+ rx0. recv ( ) . await . expect ( "Expected at least one message" ) ;
336+ rx1. recv ( ) . await . expect ( "Expected at least one message" ) ;
337+ } )
338+ . await
339+ . unwrap ( ) ;
335340 } ) ;
336341
337342 Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments