diff --git a/test/telemetry/src/main/java/org/opensearch/test/telemetry/tracing/MockTracingTelemetry.java b/test/telemetry/src/main/java/org/opensearch/test/telemetry/tracing/MockTracingTelemetry.java index c7f5943719230..d2452b2c45083 100644 --- a/test/telemetry/src/main/java/org/opensearch/test/telemetry/tracing/MockTracingTelemetry.java +++ b/test/telemetry/src/main/java/org/opensearch/test/telemetry/tracing/MockTracingTelemetry.java @@ -21,7 +21,7 @@ public class MockTracingTelemetry implements TracingTelemetry { private final SpanProcessor spanProcessor = new StrictCheckSpanProcessor(); - private final AtomicBoolean shutdown = new AtomicBoolean(false); + private static final AtomicBoolean shutdown = new AtomicBoolean(false); /** * Base constructor. @@ -44,7 +44,9 @@ public TracingContextPropagator getContextPropagator() { @Override public void close() { - shutdown.set(true); + if (shutdown.get() == false) { + shutdown.set(true); + } } }