@@ -642,8 +642,10 @@ mod tests {
642642 #[ tokio:: test]
643643 async fn test_batch_span_processor ( ) {
644644 let ( exporter, mut export_receiver, _shutdown_receiver) = new_tokio_test_exporter ( ) ;
645- let mut config = BatchConfig :: default ( ) ;
646- config. scheduled_delay = Duration :: from_secs ( 60 * 60 * 24 ) ; // set the tick to 24 hours so we know the span must be exported via force_flush
645+ let config = BatchConfig {
646+ scheduled_delay : Duration :: from_secs ( 60 * 60 * 24 ) , // set the tick to 24 hours so we know the span must be exported via force_flush
647+ ..Default :: default ( )
648+ } ;
647649 let spawn = |fut| tokio:: task:: spawn_blocking ( || futures:: executor:: block_on ( fut) ) ;
648650 let mut processor = BatchSpanProcessor :: new (
649651 Box :: new ( exporter) ,
@@ -740,9 +742,11 @@ mod tests {
740742 // otherwise the exporter should be able to export within time out duration.
741743 #[ cfg( feature = "async-std" ) ]
742744 async fn timeout_test_std_async ( time_out : bool ) {
743- let mut config = BatchConfig :: default ( ) ;
744- config. max_export_timeout = time:: Duration :: from_millis ( if time_out { 5 } else { 60 } ) ;
745- config. scheduled_delay = Duration :: from_secs ( 60 * 60 * 24 ) ; // set the tick to 24 hours so we know the span must be exported via force_flush
745+ let config = BatchConfig {
746+ max_export_timeout : time:: Duration :: from_millis ( if time_out { 5 } else { 60 } ) ,
747+ scheduled_delay : Duration :: from_secs ( 60 * 60 * 24 ) , // set the tick to 24 hours so we know the span must be exported via force_flush
748+ ..Default :: default ( )
749+ } ;
746750 let exporter = BlockingExporter {
747751 delay_for : time:: Duration :: from_millis ( if !time_out { 5 } else { 60 } ) ,
748752 delay_fn : async_std:: task:: sleep,
@@ -768,9 +772,11 @@ mod tests {
768772 // If the time_out is true, then the result suppose to ended with timeout.
769773 // otherwise the exporter should be able to export within time out duration.
770774 async fn timeout_test_tokio ( time_out : bool ) {
771- let mut config = BatchConfig :: default ( ) ;
772- config. max_export_timeout = time:: Duration :: from_millis ( if time_out { 5 } else { 60 } ) ;
773- config. scheduled_delay = Duration :: from_secs ( 60 * 60 * 24 ) ; // set the tick to 24 hours so we know the span must be exported via force_flush
775+ let config = BatchConfig {
776+ max_export_timeout : time:: Duration :: from_millis ( if time_out { 5 } else { 60 } ) ,
777+ scheduled_delay : Duration :: from_secs ( 60 * 60 * 24 ) , // set the tick to 24 hours so we know the span must be exported via force_flush,
778+ ..Default :: default ( )
779+ } ;
774780 let exporter = BlockingExporter {
775781 delay_for : time:: Duration :: from_millis ( if !time_out { 5 } else { 60 } ) ,
776782 delay_fn : tokio:: time:: delay_for,
0 commit comments