@@ -363,8 +363,8 @@ mod test {
363363 Child , ChildManager , ChildUpdate , ChildWorkScheduler , ResolverUpdateSharder ,
364364 } ;
365365 use crate :: client:: load_balancing:: test_utils:: {
366- self , StubPolicy , StubPolicyFuncs , TestChannelController , TestEvent , TestSubchannel ,
367- TestWorkScheduler ,
366+ self , StubPolicy , StubPolicyData , StubPolicyFuncs , TestChannelController , TestEvent ,
367+ TestSubchannel , TestWorkScheduler ,
368368 } ;
369369 use crate :: client:: load_balancing:: {
370370 ChannelController , LbPolicy , LbPolicyBuilder , LbPolicyOptions , LbState , ParsedJsonLbConfig ,
@@ -444,7 +444,7 @@ mod test {
444444 let ( tx_events, rx_events) = mpsc:: unbounded_channel :: < TestEvent > ( ) ;
445445 let tcc = Box :: new ( TestChannelController { tx_events } ) ;
446446 let builder: Arc < dyn LbPolicyBuilder > = GLOBAL_LB_REGISTRY . get_policy ( test_name) . unwrap ( ) ;
447- let endpoint_sharder = EndpointSharder { builder : builder } ;
447+ let endpoint_sharder = EndpointSharder { builder } ;
448448 let child_manager = ChildManager :: new ( Box :: new ( endpoint_sharder) , default_runtime ( ) ) ;
449449 ( rx_events, Box :: new ( child_manager) , tcc)
450450 }
@@ -517,25 +517,29 @@ mod test {
517517 // Defines the functions resolver_update and subchannel_update to test
518518 // aggregate_states.
519519 fn create_verifying_funcs_for_aggregate_tests ( ) -> StubPolicyFuncs {
520+ let data = StubPolicyData :: new ( ) ;
520521 StubPolicyFuncs {
521522 // Closure for resolver_update. resolver_update should only receive
522523 // one endpoint and create one subchannel for the endpoint it
523524 // receives.
524- resolver_update : Some ( move |update : ResolverUpdate , _, controller| {
525- assert_eq ! ( update. endpoints. iter( ) . len( ) , 1 ) ;
526- let endpoint = update. endpoints . unwrap ( ) . pop ( ) . unwrap ( ) ;
527- let subchannel = controller. new_subchannel ( & endpoint. addresses [ 0 ] ) ;
528- Ok ( ( ) )
529- } ) ,
525+ resolver_update : Some ( Arc :: new (
526+ move |data, update : ResolverUpdate , _, controller| {
527+ assert_eq ! ( update. endpoints. iter( ) . len( ) , 1 ) ;
528+ let endpoint = update. endpoints . unwrap ( ) . pop ( ) . unwrap ( ) ;
529+ let subchannel = controller. new_subchannel ( & endpoint. addresses [ 0 ] ) ;
530+ Ok ( ( ) )
531+ } ,
532+ ) ) ,
530533 // Closure for subchannel_update. Sends a picker of the same state
531534 // that was passed to it.
532- subchannel_update : Some ( move |updated_subchannel, state, controller| {
533- controller. update_picker ( LbState {
534- connectivity_state : state. connectivity_state ,
535- picker : Arc :: new ( QueuingPicker { } ) ,
536- } ) ;
537- } ) ,
538- ..Default :: default ( )
535+ subchannel_update : Some ( Arc :: new (
536+ move |data, updated_subchannel, state, controller| {
537+ controller. update_picker ( LbState {
538+ connectivity_state : state. connectivity_state ,
539+ picker : Arc :: new ( QueuingPicker { } ) ,
540+ } ) ;
541+ } ,
542+ ) ) ,
539543 }
540544 }
541545
0 commit comments