From 914721e041a2abf8d49e92aa42d2752988dab102 Mon Sep 17 00:00:00 2001 From: paullegranddc Date: Tue, 11 Mar 2025 14:09:04 +0100 Subject: [PATCH] Fix test failing on default features --- opentelemetry-sdk/src/trace/span_processor.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/opentelemetry-sdk/src/trace/span_processor.rs b/opentelemetry-sdk/src/trace/span_processor.rs index b15db77763..c3d5a52ac7 100644 --- a/opentelemetry-sdk/src/trace/span_processor.rs +++ b/opentelemetry-sdk/src/trace/span_processor.rs @@ -971,15 +971,20 @@ mod tests { .with_scheduled_delay(Duration::from_millis(10)) .with_max_queue_size(10); #[cfg(feature = "experimental_trace_batch_span_processor_with_async_runtime")] - let batch = batch.with_max_concurrent_exports(10); - #[cfg(feature = "experimental_trace_batch_span_processor_with_async_runtime")] - let batch = batch.with_max_export_timeout(Duration::from_millis(10)); + let batch = { + batch + .with_max_concurrent_exports(10) + .with_max_export_timeout(Duration::from_millis(10)) + }; let batch = batch.build(); 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); + #[cfg(feature = "experimental_trace_batch_span_processor_with_async_runtime")] + { + assert_eq!(batch.max_concurrent_exports, 10); + assert_eq!(batch.max_export_timeout, Duration::from_millis(10)); + } } // Helper function to create a default test span