Skip to content

Give each test session its own tmp root - #146

Merged
ajslater merged 1 commit into
developfrom
claude/busy-elbakyan-1c09c3
Oct 4, 2026
Merged

ajslater merged 1 commit into
developfrom
claude/busy-elbakyan-1c09c3

Conversation

@ajslater

@ajslater ajslater commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Test dirs lived at fixed /tmp/picopt-tests.<module> paths, so concurrent make test runs from different git worktrees set up and tore down each other's files (~30 spurious FileNotFoundErrors in test_images_dir.py / test_containers.py).
  • tests/__init__.py now creates TMP_ROOT once per session with tempfile.mkdtemp(prefix="picopt-") and removes it at exit. Module dirs become $TMPDIR/picopt-XXXXXXXX/tests.<module>.
  • Drops the # noqa: S108. No test modules or assertions change; every module already gets its dir from get_test_dir().

Test plan

  • make fix, make lint, make ty clean
  • make test: 424 passed, 6 skipped
  • Two full make test runs concurrently from two worktrees: both passed (422 passed, 6 skipped each, on the pre-Keep a directory config's dry_run from turning a tree's timestamps off #144 base), with simultaneous snapshots showing both runs in test_containers / test_images_dir at once under separate roots
  • No temp roots left behind after any run

🤖 Generated with Claude Code

Test dirs lived at fixed /tmp/picopt-tests.<module> paths, so concurrent
`make test` runs from different worktrees set up and tore down each
other's files, failing with spurious FileNotFoundErrors. Create the root
once per session with tempfile.mkdtemp and remove it at exit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ajslater
ajslater merged commit b5c363d into develop Oct 4, 2026
7 checks passed
@ajslater
ajslater deleted the claude/busy-elbakyan-1c09c3 branch October 4, 2026 03:22
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