Skip to content

fix(tests): keep Hypothesis temp files out of the repo-mirror fixtures - #824

Merged
sumithr merged 1 commit into
mainfrom
fix/issue-823-hypothesis-copytree-race
Oct 3, 2026
Merged

sumithr merged 1 commit into
mainfrom
fix/issue-823-hypothesis-copytree-race

Conversation

@sumithr

@sumithr sumithr commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Summary

The two repo-mirror fixtures copy the whole repo with shutil.copytree. Under pytest-xdist another worker's Hypothesis run creates and deletes files in .hypothesis/tmp during that copy, and a file that vanishes mid-copy fails the fixture with shutil.Error ... [Errno 2]. Both fixtures now ignore .hypothesis, as they already ignore .pytest_cache, .mutmut-cache and coverage files.

Related issue

Closes #823

Changes

  • tests/test_plugin_packaging_generator.py and tests/test_plugin_packaging_schema_validation.py: ".hypothesis" added to the ignore_patterns of the repo-mirror copy. No other test copies the repo root.

How it was verified

  • A throwaway script ran the fixture's copytree 15 times while a thread created and deleted files in <repo>/.hypothesis/tmp: without the ignore 9 of 15 copies failed; with it 0 of 15.
  • The two modules: 18 passed. The two modules under -n 4 --dist loadfile alongside a Hypothesis module: 204 passed.
  • Pre-push hook: full suite 5290 passed, 100% coverage.

Checklist

  • PR title follows Conventional Commits
  • Tests pass locally (pytest) and lint/type checks are green
  • Added or updated tests covering the change
  • Updated the relevant docs in this same PR
  • No breaking changes

@sumithr

sumithr commented Oct 3, 2026

Copy link
Copy Markdown
Owner Author

Finish proof, head f9409c0

CI: 27 of 27 checks pass. Mutation gate: run 37079778783, success. Open review threads: 0.

Review: two-line diff (".hypothesis" added to the repo-mirror ignore_patterns in tests/test_plugin_packaging_generator.py and tests/test_plugin_packaging_schema_validation.py), reviewed at the orchestrator, which did not write it: SAFE. No other test copies the repo root (tests/test_server_schemas.py copies a fixture catalogue, tests/test_external_skills_provenance.py a skill dir).

Behaviour ledger (finish-pr 4.7):

# expected behaviour real-surface call + input observed output Met
1 The repo-mirror copy never reads another worker's Hypothesis temp files the fixtures' copytree of the real repo, 15 times, while a thread creates and deletes files in <repo>/.hypothesis/tmp without the ignore: 9 of 15 copies fail with shutil.Error ... [Errno 2]; with it: 0 of 15, and .hypothesis never appears in the copy Met
2 The affected modules pass under xdist beside a Hypothesis module pytest -n 4 --dist loadfile on the two modules plus tests/test_conformance_transcript_validator.py 204 passed Met
  • real_repo: this repository's working tree. existing_flow: N/A, tests only. evals: N/A, no eval input.

@sumithr
sumithr merged commit 9c77462 into main Oct 3, 2026
28 checks passed
@sumithr
sumithr deleted the fix/issue-823-hypothesis-copytree-race branch October 3, 2026 01:02
sumithr added a commit that referenced this pull request Oct 3, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.71.1](v0.71.0...v0.71.1)
(2026-10-03)


### Bug Fixes

* **skills:** decide executable-ness by behaviour, not path, in routing
and review ([#818](#818))
([4f5e3c4](4f5e3c4))
* **tests:** keep Hypothesis temp files out of the repo-mirror fixtures
([#824](#824))
([9c77462](9c77462))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <release-please[bot]@users.noreply.github.com>
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.

[Bug]: repo-mirror test fixtures race Hypothesis temp files under pytest-xdist

1 participant