Skip to content

Conversation

@cdecker
Copy link
Member

@cdecker cdecker commented Jan 14, 2026

This PR fixes issues with the logging library raising exceptions when pytest swaps out sys.stdout/sys.stderr for output capture.

Changes

  1. Added TEST_LOG_IGNORE_ERRORS environment variable to disable logging.raiseExceptions in the test setup fixture
  2. Set TEST_LOG_IGNORE_ERRORS=1 in:
    • GitHub Actions CI workflow (.github/workflows/ci.yaml)
    • Coverage nightly workflow (.github/workflows/coverage-nightly.yaml)
    • Makefile test target
    • Taskfile.yml

Problem

The logging library was raising exceptions when pytest captured output by temporarily replacing sys.stdout/sys.stderr. This caused test failures due to logging handlers attempting to write to closed file descriptors.

Solution

When TEST_LOG_IGNORE_ERRORS=1 is set, the test fixture now disables logging.raiseExceptions, allowing tests to continue even if logging encounters errors during pytest's output capture.

Only record trace events that take at least 1 second, reducing noise
from hundreds of tiny quick operations. This makes the trace output
cleaner and easier to analyze by focusing on the actual bottlenecks.
Flow events now correctly use 'ph': 's' (flow start) for the parent
endpoint and 'ph': 'f' (flow finish) for the child endpoint. This
follows the Chrome Trace Event Format specification for well-formed
flows. Removed redundant bind_id field.
@cdecker cdecker force-pushed the 202601-logging-denoise branch from f832c6d to 9f468a2 Compare January 14, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants