@@ -1240,7 +1240,6 @@ mod tests {
1240
1240
let config = BatchConfigBuilder :: default ( )
1241
1241
. with_max_queue_size ( 5 )
1242
1242
. with_max_export_batch_size ( 3 )
1243
- . with_scheduled_delay ( Duration :: from_millis ( 50 ) )
1244
1243
. build ( ) ;
1245
1244
1246
1245
let processor = BatchSpanProcessor :: new ( exporter, config) ;
@@ -1250,7 +1249,7 @@ mod tests {
1250
1249
processor. on_end ( span) ;
1251
1250
}
1252
1251
1253
- tokio :: time :: sleep ( Duration :: from_millis ( 1000 ) ) . await ;
1252
+ processor . force_flush ( ) . unwrap ( ) ;
1254
1253
1255
1254
let exported_spans = exporter_shared. lock ( ) . unwrap ( ) ;
1256
1255
assert_eq ! ( exported_spans. len( ) , 4 ) ;
@@ -1264,7 +1263,6 @@ mod tests {
1264
1263
let config = BatchConfigBuilder :: default ( )
1265
1264
. with_max_queue_size ( 5 )
1266
1265
. with_max_export_batch_size ( 3 )
1267
- . with_scheduled_delay ( Duration :: from_millis ( 50 ) )
1268
1266
. build ( ) ;
1269
1267
1270
1268
let processor = BatchSpanProcessor :: new ( exporter, config) ;
@@ -1274,7 +1272,7 @@ mod tests {
1274
1272
processor. on_end ( span) ;
1275
1273
}
1276
1274
1277
- tokio :: time :: sleep ( Duration :: from_millis ( 1000 ) ) . await ;
1275
+ processor . force_flush ( ) . unwrap ( ) ;
1278
1276
1279
1277
let exported_spans = exporter_shared. lock ( ) . unwrap ( ) ;
1280
1278
assert_eq ! ( exported_spans. len( ) , 4 ) ;
@@ -1288,7 +1286,6 @@ mod tests {
1288
1286
let config = BatchConfigBuilder :: default ( )
1289
1287
. with_max_queue_size ( 20 )
1290
1288
. with_max_export_batch_size ( 5 )
1291
- . with_scheduled_delay ( Duration :: from_millis ( 50 ) )
1292
1289
. build ( ) ;
1293
1290
1294
1291
// Create the processor with the thread-safe exporter
@@ -1308,8 +1305,7 @@ mod tests {
1308
1305
handle. await . unwrap ( ) ;
1309
1306
}
1310
1307
1311
- // Allow time for batching and export
1312
- tokio:: time:: sleep ( Duration :: from_millis ( 1000 ) ) . await ;
1308
+ processor. force_flush ( ) . unwrap ( ) ;
1313
1309
1314
1310
// Verify exported spans
1315
1311
let exported_spans = exporter_shared. lock ( ) . unwrap ( ) ;
0 commit comments