Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions opentelemetry-sdk/src/logs/batch_log_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -913,8 +913,7 @@ mod tests {
)
.build();

// wait for the batch processor to process the resource.
tokio::time::sleep(Duration::from_millis(100)).await;
provider.force_flush().unwrap();

assert_eq!(exporter.get_resource().unwrap().into_iter().count(), 5);
let _ = provider.shutdown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,7 @@ mod tests {
)
.build();

// wait for the batch processor to process the resource.
tokio::time::sleep(Duration::from_millis(100)).await;
provider.force_flush().unwrap();

assert_eq!(exporter.get_resource().unwrap().into_iter().count(), 5);
let _ = provider.shutdown();
Expand Down Expand Up @@ -800,7 +799,7 @@ mod tests {
KeyValue::new("k5", "v5"),
]))
.build();
tokio::time::sleep(Duration::from_millis(500)).await; // set resource in batch log processor is not blocking. Should we make it blocking?
provider.force_flush().unwrap();
assert_eq!(exporter.get_resource().unwrap().into_iter().count(), 5);
let _ = provider.shutdown();
}
Expand Down
7 changes: 3 additions & 4 deletions opentelemetry-sdk/src/trace/span_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ mod tests {
processor.on_end(span);
}

tokio::time::sleep(Duration::from_millis(1000)).await;
processor.force_flush().unwrap();

let exported_spans = exporter_shared.lock().unwrap();
assert_eq!(exported_spans.len(), 4);
Expand All @@ -1287,7 +1287,7 @@ mod tests {
processor.on_end(span);
}

tokio::time::sleep(Duration::from_millis(1000)).await;
processor.force_flush().unwrap();

let exported_spans = exporter_shared.lock().unwrap();
assert_eq!(exported_spans.len(), 4);
Expand Down Expand Up @@ -1321,8 +1321,7 @@ mod tests {
handle.await.unwrap();
}

// Allow time for batching and export
tokio::time::sleep(Duration::from_millis(1000)).await;
processor.force_flush().unwrap();

// Verify exported spans
let exported_spans = exporter_shared.lock().unwrap();
Expand Down