Skip to content

Fix ephemeral scheduler pytest fixture cleanup - #83

Merged
8Dionysus merged 2 commits into
mainfrom
fix/pytest-scheduler-ephemeral-basetemp-20260906
Sep 6, 2026
Merged

Fix ephemeral scheduler pytest fixture cleanup#83
8Dionysus merged 2 commits into
mainfrom
fix/pytest-scheduler-ephemeral-basetemp-20260906

Conversation

@8Dionysus

Copy link
Copy Markdown
Owner

Problem

Ephemeral scheduler trials put pytest's tmp_path and tmpdir fixtures under the shared host temporary root because the child pytest commands did not set --basetemp. The outer TemporaryDirectory then removed only the job artifact root, leaving fixture generations behind in pytest-of-*.

Change

Bind each scheduler pytest process to a private basetemp under its job artifact root:

  • static collection: pytest-basetemp/collection
  • each static shard: pytest-basetemp/shard-N
  • ordinary serial or xdist execution: pytest-basetemp/pytest

xdist continues to create popen-gwN worker directories beneath the per-process root. Explicit artifact and receipt runs retain the artifact tree; ephemeral runs reclaim it through the existing TemporaryDirectory owner.

Validation

  • PYTHONDONTWRITEBYTECODE=1 python3 -m pytest -q -p no:cacheprovider tests/test_validation_scheduler_experiment.py (18 passed)
  • ruff check scripts/pytest_scheduler_experiment.py tests/test_validation_scheduler_experiment.py
  • python3 -m py_compile scripts/pytest_scheduler_experiment.py tests/test_validation_scheduler_experiment.py
  • git diff --check

No full scheduler corpus run was needed for this focused lifecycle change.

@8Dionysus
8Dionysus force-pushed the fix/pytest-scheduler-ephemeral-basetemp-20260906 branch from 463d598 to 547b2d1 Compare September 6, 2026 04:49
@8Dionysus
8Dionysus merged commit e192414 into main Sep 6, 2026
2 checks passed
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.

1 participant