@@ -642,8 +642,10 @@ mod tests {
642
642
#[ tokio:: test]
643
643
async fn test_batch_span_processor ( ) {
644
644
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
+ } ;
647
649
let spawn = |fut| tokio:: task:: spawn_blocking ( || futures:: executor:: block_on ( fut) ) ;
648
650
let mut processor = BatchSpanProcessor :: new (
649
651
Box :: new ( exporter) ,
@@ -740,9 +742,11 @@ mod tests {
740
742
// otherwise the exporter should be able to export within time out duration.
741
743
#[ cfg( feature = "async-std" ) ]
742
744
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
+ } ;
746
750
let exporter = BlockingExporter {
747
751
delay_for : time:: Duration :: from_millis ( if !time_out { 5 } else { 60 } ) ,
748
752
delay_fn : async_std:: task:: sleep,
@@ -768,9 +772,11 @@ mod tests {
768
772
// If the time_out is true, then the result suppose to ended with timeout.
769
773
// otherwise the exporter should be able to export within time out duration.
770
774
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
+ } ;
774
780
let exporter = BlockingExporter {
775
781
delay_for : time:: Duration :: from_millis ( if !time_out { 5 } else { 60 } ) ,
776
782
delay_fn : tokio:: time:: delay_for,
0 commit comments