@@ -285,8 +285,8 @@ mod tests {
285285 use opentelemetry:: logs:: Severity ;
286286 use opentelemetry:: trace:: TracerProvider ;
287287 use opentelemetry:: trace:: { TraceContextExt , TraceFlags , Tracer } ;
288- use opentelemetry:: InstrumentationScope ;
289288 use opentelemetry:: { logs:: AnyValue , Key } ;
289+ use opentelemetry:: { Context , InstrumentationScope } ;
290290 use opentelemetry_sdk:: error:: { OTelSdkError , OTelSdkResult } ;
291291 use opentelemetry_sdk:: logs:: { InMemoryLogExporter , LogProcessor } ;
292292 use opentelemetry_sdk:: logs:: { LogBatch , LogExporter } ;
@@ -319,25 +319,26 @@ mod tests {
319319
320320 impl LogExporter for ReentrantLogExporter {
321321 async fn export ( & self , _batch : LogBatch < ' _ > ) -> OTelSdkResult {
322- // This will cause a deadlock as the export itself creates a log
322+ let _suppress = Context :: enter_telemetry_suppressed_scope ( ) ;
323+ // Without the suppression above, this will cause a deadlock as the export itself creates a log
323324 // while still within the lock of the SimpleLogProcessor.
324325 warn ! ( name
: "my-event-name" , target
: "reentrant" , event_id =
20 , user_name =
"otel" , user_email =
"[email protected] " ) ; 325326 Ok ( ( ) )
326327 }
327328 }
328329
329330 #[ test]
330- #[ ignore = "See issue: https://github.com/open-telemetry/opentelemetry-rust/issues/1745 " ]
331+ #[ ignore = "While this test runs fine, this uses global subscriber and does not play well with other tests and hence ignored in CI. " ]
331332 fn simple_processor_deadlock ( ) {
333+ // TODO: This test maybe better suited in the opentelemetry-sdk crate tests
332334 let exporter: ReentrantLogExporter = ReentrantLogExporter ;
333335 let logger_provider = SdkLoggerProvider :: builder ( )
334- . with_simple_exporter ( exporter. clone ( ) )
336+ . with_simple_exporter ( exporter)
335337 . build ( ) ;
336338
337339 let layer = layer:: OpenTelemetryTracingBridge :: new ( & logger_provider) ;
338-
339- // Setting subscriber as global as that is the only way to test this scenario.
340340 tracing_subscriber:: registry ( ) . with ( layer) . init ( ) ;
341+
341342 warn ! ( name
: "my-event-name" , target
: "my-system" , event_id =
20 , user_name =
"otel" , user_email =
"[email protected] " ) ; 342343 }
343344
0 commit comments