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).
Found while reviewing #630 (the
test_full_pipelinetracer-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.pytogether 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 OTelTracerProvideris 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 runsunit + integrationtogether (where #630's now-fixed leak manifested). So this is a latent, order-dependent fragility, not a current CI failure.Fix direction: an
autousefixture 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).