test(telemetry): stop otlp export leaking between tests - #913
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: LucStr <25279790+LucStr@users.noreply.github.com>
7a44bc6 to
b8fef8c
Compare
✅ No skill update needed — confirmed by @LinoGigerThis PR does not modify Before merging, pick one:
|
|
Rebased onto The remaining red check, Agent Skill, is the review gate added in #911, not a failure of this change: this PR only touches |
Constructing any LoggingConfig pushed its settings to the global tracer and logger, so a standalone LoggingConfig(enable_otlp=True) re-enabled OTLP for the whole process. Only the global rapidata_config.logging now notifies the handlers; the conftest resync from #913 stays as a test-side backstop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: luca@rapidata.ai <25279790+LucStr@users.noreply.github.com>
Problem
Prod OTel still receives ~24 error spans from
Rapidata.Python.SDKper test-suite run (MagicMock payloads,job-1, TTL validation errors), even though #814 disabled OTLP in tests. Last 24h: 120 of the 120 SDK error spans were test runs.Cause
LoggingConfig.__init__broadcasts to every registered handler, including the global tracer.test_explicit_true_overrides_the_pytest_defaultbuildsLoggingConfig(enable_otlp=True), so the global tracer is turned on for every test collected afterconfig/.Repro on
main: runtest_otlp_default.pyfollowed by a probe test.tracer._enabledisTruein the probe.Fix
Add an autouse fixture in
tests/conftest.pythat re-syncs handlers to the globalrapidata_config.loggingafter each test. No test that builds aLoggingConfigcan leak export into later tests any more.Verification
test_otlp_default.py:tracer._enabledisFalse.🔗 Session: https://poseidon.rapidata.internal/chat/node-4227a31892d6
🤖 Generated with Claude Code