Skip to content

Fix config leak in TestExecutorConf causing CeleryExecutor test failures#65123

Closed
dandanseo123 wants to merge 2 commits intoapache:mainfrom
dandanseo123:fix/celery-ssl-test-config-leak
Closed

Fix config leak in TestExecutorConf causing CeleryExecutor test failures#65123
dandanseo123 wants to merge 2 commits intoapache:mainfrom
dandanseo123:fix/celery-ssl-test-config-leak

Conversation

@dandanseo123
Copy link
Copy Markdown
Contributor

@dandanseo123 dandanseo123 commented Apr 13, 2026

Description

TestExecutorConf tests used conf.read_string() to set config values like ssl_active=true without cleanup, leaking state into subsequent tests. This was harmless until #64767 added SSL validation to the CeleryExecutor. So the leaked ssl_active=true now triggers a ValueError in unrelated test_executor_loader tests.

Added an autouse fixture that snapshots and restores the config state after each test.

follow-up: #64767


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code

Generated-by: Claude Code following the guidelines

TestExecutorConf tests used conf.read_string() to set config values
like ssl_active=true without cleanup, leaking state into subsequent
tests. This caused CeleryExecutor SSL validation (added in apache#64767) to
raise ValueError in unrelated test_executor_loader tests.
Copy link
Copy Markdown
Contributor

@wjddn279 wjddn279 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Test failure will be resolved

@@ -411,6 +411,23 @@ def test_repr():
class TestExecutorConf:
"""Test ExecutorConf shim class that provides team-specific configuration access."""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just ran into the bug this is fixing, thanks for fixing it so fast. I'd suggest using conf_vars in the tests instead of reinventing the wheel here though. If you use conf_vars, then it resets the values back after the test finishes.

Copy link
Copy Markdown
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of this should be needed, as we have the @conf_vars fixture instead that alreqady handles this and sets config values for the specific test.

The fix should be to use that pre-existing fixture/config override mechanism as ferruzzi says.

@dandanseo123
Copy link
Copy Markdown
Contributor Author

We can close this PR as PR 65126 fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Executors-core LocalExecutor & SequentialExecutor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants