Skip to content

Fix test_env leaking config overrides into other tests#898

Merged
mlin merged 1 commit into
chanzuckerberg:mainfrom
mlin:fix-test-env-leak
Jun 27, 2026
Merged

Fix test_env leaking config overrides into other tests#898
mlin merged 1 commit into
chanzuckerberg:mainfrom
mlin:fix-test-env-leak

Conversation

@Wid-L-Hacker

Copy link
Copy Markdown
Contributor

No description provided.

test_env set os.environ MINIWDL_CFG (to a delete=False temp config with
copy_input_files=true), MINIWDL__SCHEDULER__TASK_CONCURRENCY, and
MINIWDL__BOGUS__OPTION without ever restoring them or removing the temp file.
Under pytest-xdist a worker runs many tests in one process, so the leaked
MINIWDL_CFG caused later tests' config Loaders to pick up copy_input_files=true
-- which made test_7runner's source-relative file_io.root assertions stop
raising ("InputError not raised"), order-dependently.

Restore the environment and unlink the temp file via addCleanup so the test is
hermetic. (test_7runner Loaders were independently hardened to ignore config
files; this removes the leak at its source, including the env overrides that an
empty filenames list does not suppress.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mlin mlin marked this pull request as ready for review June 27, 2026 06:02
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 28280636726

Coverage remained the same at 95.86%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 9179
Covered Lines: 8799
Line Coverage: 95.86%
Coverage Strength: 0.96 hits per line

💛 - Coveralls

@mlin mlin merged commit 3702a2d into chanzuckerberg:main Jun 27, 2026
8 checks passed
@mlin mlin deleted the fix-test-env-leak branch June 27, 2026 07:01
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.

3 participants