Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
Signed-off-by: zengxilong <zengxilonglh@gmail.com>
  • Loading branch information
zengxilong committed Aug 30, 2022
1 parent 3fe4652 commit 76a41e0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions opentelemetry-sdk/src/trace/span_processor.rs
Expand Up @@ -694,6 +694,21 @@ mod tests {
assert!(rx_shutdown.try_recv().is_ok());
}

#[test]
fn test_batch_config_with_fields() {
let batch = BatchConfig::default()
.with_max_export_batch_size(10)
.with_scheduled_delay(Duration::from_millis(10))
.with_max_export_timeout(Duration::from_millis(10))
.with_max_concurrent_exports(10)
.with_max_queue_size(10);
assert_eq!(batch.max_export_batch_size, 10);
assert_eq!(batch.scheduled_delay, Duration::from_millis(10));
assert_eq!(batch.max_export_timeout, Duration::from_millis(10));
assert_eq!(batch.max_concurrent_exports, 10);
assert_eq!(batch.max_queue_size, 10);
}

#[test]
fn test_build_batch_span_processor_builder() {
std::env::set_var(OTEL_BSP_MAX_EXPORT_BATCH_SIZE, "500");
Expand Down

0 comments on commit 76a41e0

Please sign in to comment.