Skip to content

test-isolation: global set_tracer_provider collision across agent test modules (14 failures when run together) #641

Description

@anilmurty

Found while reviewing #630 (the test_full_pipeline tracer-leak fix). Separate, pre-existing test-isolation bug — not introduced by #630.

Symptom: running tests/integration/test_full_pipeline.py + tests/agents/test_record_outcome.py + tests/agents/test_mock_scenarios.py together yields ~14 failures — both WITH and WITHOUT #630's patch.

Root cause: two module-level set_tracer_provider() calls collide. Per Critical Rule #11, the global OTel TracerProvider is set-once per process — a second module setting its own provider (or relying on a different one) breaks interception in the other.

Why CI is still green: it does not affect CI's collection order — tests/agents/ alone passes, and CI runs unit + integration together (where #630's now-fixed leak manifested). So this is a latent, order-dependent fragility, not a current CI failure.

Fix direction: an autouse fixture that snapshots + restores the global provider (and/or the module-level _tracer) around each agent-test module, per Rule #11 — closing the class of bug rather than the single instance.

Out of scope for #630 (which correctly did the narrow per-fixture restore for #615).

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