File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -913,8 +913,7 @@ mod tests {
913913 )
914914 . build ( ) ;
915915
916- // wait for the batch processor to process the resource.
917- tokio:: time:: sleep ( Duration :: from_millis ( 100 ) ) . await ;
916+ provider. force_flush ( ) . unwrap ( ) ;
918917
919918 assert_eq ! ( exporter. get_resource( ) . unwrap( ) . into_iter( ) . count( ) , 5 ) ;
920919 let _ = provider. shutdown ( ) ;
Original file line number Diff line number Diff line change @@ -541,8 +541,7 @@ mod tests {
541541 )
542542 . build ( ) ;
543543
544- // wait for the batch processor to process the resource.
545- tokio:: time:: sleep ( Duration :: from_millis ( 100 ) ) . await ;
544+ provider. force_flush ( ) . unwrap ( ) ;
546545
547546 assert_eq ! ( exporter. get_resource( ) . unwrap( ) . into_iter( ) . count( ) , 5 ) ;
548547 let _ = provider. shutdown ( ) ;
@@ -804,7 +803,7 @@ mod tests {
804803 KeyValue :: new( "k5" , "v5" ) ,
805804 ] ) )
806805 . build ( ) ;
807- tokio :: time :: sleep ( Duration :: from_millis ( 500 ) ) . await ; // set resource in batch log processor is not blocking. Should we make it blocking?
806+ provider . force_flush ( ) . unwrap ( ) ;
808807 assert_eq ! ( exporter. get_resource( ) . unwrap( ) . into_iter( ) . count( ) , 5 ) ;
809808 let _ = provider. shutdown ( ) ;
810809 }
Original file line number Diff line number Diff line change @@ -1268,7 +1268,7 @@ mod tests {
12681268 processor. on_end ( span) ;
12691269 }
12701270
1271- tokio :: time :: sleep ( Duration :: from_millis ( 1000 ) ) . await ;
1271+ processor . force_flush ( ) . unwrap ( ) ;
12721272
12731273 let exported_spans = exporter_shared. lock ( ) . unwrap ( ) ;
12741274 assert_eq ! ( exported_spans. len( ) , 4 ) ;
@@ -1292,7 +1292,7 @@ mod tests {
12921292 processor. on_end ( span) ;
12931293 }
12941294
1295- tokio :: time :: sleep ( Duration :: from_millis ( 1000 ) ) . await ;
1295+ processor . force_flush ( ) . unwrap ( ) ;
12961296
12971297 let exported_spans = exporter_shared. lock ( ) . unwrap ( ) ;
12981298 assert_eq ! ( exported_spans. len( ) , 4 ) ;
@@ -1326,8 +1326,7 @@ mod tests {
13261326 handle. await . unwrap ( ) ;
13271327 }
13281328
1329- // Allow time for batching and export
1330- tokio:: time:: sleep ( Duration :: from_millis ( 1000 ) ) . await ;
1329+ processor. force_flush ( ) . unwrap ( ) ;
13311330
13321331 // Verify exported spans
13331332 let exported_spans = exporter_shared. lock ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments