Skip to content

Navigation Menu

Sign in
Sign up

Flaky: trace_context_lookup_does_not_enable_callsites fails under parallel test execution (global callsite registry) #7404

Open

Description

Summary

telemetry::tests::trace_context_lookup_does_not_enable_callsites (crates/buzz-relay/src/telemetry.rs) fails when run in parallel with the rest of the relay suite and passes in isolation. This is a test-isolation defect rather than a product bug, but it makes the relay suite unreliable under cargo test.

Mechanism

The test installs its subscriber with tracing::subscriber::with_default(...), which is thread-local. However, tracing's callsite registry is process-global and sticky: once a callsite has been enabled by any subscriber in the process, that registration persists.

So a concurrently-running test that installs a subscriber enabling those callsites permanently defeats this test's assertion, regardless of its own thread-local default. The failure is therefore a function of which tests run alongside it, not of the code under test.

Introduced with the tracing correlation work in 005b5b8 ("feat(tracing): correlate trace IDs in relay logs", #3608).

Reproduction

Run the full buzz-relay lib test suite in parallel. The test passes when run alone.

Why no patch is attached

The fix is a design choice for the maintainers rather than a mechanical repair — plausible options include serialising the telemetry tests, isolating them in their own binary, or making the assertion robust to prior global callsite registration. We did not want to pick one on your behalf.

Context

Found while validating a rebase against main. Two other issues surfaced in the same run and have patches attached: #7401 (pool-acquisition attribution regression) and #7402 (mesh demo test lease). Reporting this one rather than patching it.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      AltStyle によって変換されたページ (->オリジナル) /