wip(ci_visibility): preserve pytest log delivery - #20133
Conversation
Co-authored-by: gnufede <412857+gnufede@users.noreply.github.com>
Co-authored-by: gnufede <412857+gnufede@users.noreply.github.com>
|
Bits Code status: ✅ Done Comment @DataDog to request changes |
|
I can only run on private repositories. |
Codeowners resolved asResolved from the full PR diff against |
Circular import analysis
|
Dependency direction analysis
|
There was a problem hiding this comment.
More details
The filter blocks ddtrace records only when a standard stream handler has a closed stream. It keeps log delivery to all open handlers.
🤖 Datadog Autotest · Commit 6dc5f3a · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
Description
Fix the closed-stream shutdown error in #16712 without the whole-process loss of tracer log delivery exposed by the compatibility probes for #20101.
Testing
Python 3.13.13:
Risks
The protection is deliberately limited to existing standard stream handlers at pytest teardown; custom/file handler behavior is unchanged. Handlers installed after pytest returns remain the caller's responsibility. The filter checks whether a stream is already closed at dispatch, not arbitrary concurrent closure between filtering and writing. The submission probe uses the real handler with a mock writer; it does not validate remote intake delivery.
Additional Notes
No global logging monkeypatch, no global exception suppression, and no early shutdown of the global tracer. No commit, push, or remote PR update performed.
PR by Bits - View session in Datadog
Comment @DataDog to request changes