Skip to content

Conversation

@thrawn01
Copy link
Contributor

Purpose

Fixes flaky test failures in TestNewTracerUsesGlobalProviderWhenNoneProvided where the test expected 1 tracer request but received 3.

Implementation

  • Removed t.Parallel() from TestNewTracerUsesGlobalProviderWhenNoneProvided and TestNewTracerRespectsCustomProviderOption
  • These tests modify the global otel.TracerProvider via otel.SetTracerProvider(), which causes race conditions when running in parallel with other tests that also call NewTracer()
  • Other tracer tests that don't modify global state retain t.Parallel() for performance

Tests that call otel.SetTracerProvider() were running in parallel,
causing race conditions where multiple tests would interfere with
each other's global state. This resulted in flaky test failures where
rec.requested contained extra entries from other parallel tests.
@thrawn01 thrawn01 self-assigned this Dec 25, 2025
@thrawn01 thrawn01 merged commit ef14c6f into main Dec 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants