Skip to content

Test fix in main Celery worker tests leaking logging handler onto captured stdout - #69163

Merged
shahar1 merged 1 commit into
apache:mainfrom
anishgirianish:fix-celery-worker-test-logging-leak
Jun 30, 2026
Merged

Test fix in main Celery worker tests leaking logging handler onto captured stdout#69163
shahar1 merged 1 commit into
apache:mainfrom
anishgirianish:fix-celery-worker-test-logging-leak

Conversation

@anishgirianish

@anishgirianish anishgirianish commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

The Celery worker CLI tests call the real configure_logging(output=sys.stdout.buffer), which installs a logging handler on pytest's captured stdout. Once the capture buffer closes, every later test's setup/teardown logging fails with I/O operation on closed file, surfacing in the Postgres-backed Special test jobs (Pendulum2 / LatestBoto).

This adds an autouse fixture stubbing configure_logging (matching what TestWorkerJsonLogs already does per-test), so the handler is never installed


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@anishgirianish
anishgirianish force-pushed the fix-celery-worker-test-logging-leak branch from bbd85e7 to eb08665 Compare June 30, 2026 06:09
@anishgirianish anishgirianish changed the title Fix Celery worker tests leaking logging handler onto captured stdou Fix Celery worker tests leaking logging handler onto captured stdout in main Jun 30, 2026
@anishgirianish anishgirianish changed the title Fix Celery worker tests leaking logging handler onto captured stdout in main Test fix in main Celery worker tests leaking logging handler onto captured stdout Jun 30, 2026
@shahar1
shahar1 merged commit 1b6ff20 into apache:main Jun 30, 2026
76 checks passed
karenbraganz pushed a commit to karenbraganz/airflow that referenced this pull request Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants