Repository navigation
Own and bound managed pytest scratch - #4130
Conversation
Problem: managed pytest could retain a shared basetemp indefinitely, allowing one run to collide with another and leaving incident-scale trees behind. What changed: allocate a measured per-run, per-lane scratch lease; retain bounded failure artifacts; reclaim dead and empty lease containers; and emit per-test and per-worker storage facts. Compatibility: managed devtools pytest now owns --basetemp so callers cannot route it to a shared path.
Problem: managed pytest cancellation could leave a live child writing into a lease that a later run reclaimed, while failure diagnostics and high-water receipts were vulnerable to races or overstated their scope. What changed: run pytest in an owned process group, serialize lease creation and pruning, bind cleanup to a lease token, bound no-follow diagnostic copies, preserve signal-specific cancellation, and expose explicitly scoped scratch metrics through the run receipt. Compatibility: devtools test and devtools verify continue to own --basetemp; standalone coverage, SLO, CI, and benchmark workflows remain separate direct-run boundaries.
Patch subprocess and process-group calls through pytest's dotted-path API so the behavioral test does not expose private module imports as public attributes. Verification: pytest tests/unit/devtools/test_pytest_scratch.py.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e29bb1db9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
## Summary Deletes the verifier's duplicate host-process, scratch, and worktree authority (polylogue-agentctl.2.1): −1198 LOC of local supervision, scratch leases/admission, resource placement, and stall detection. The verifier keeps pytest semantics; process/resource/scratch governance lives in the AgentCTL operation descriptors that already run every corpus and lane verification. ## Problem Two authorities governed the same execution: verifier-local leases/supervision (transitional, #4130-era) and AgentCTL's declared operations (pool, scratch, admission, timeouts). One canonical route per the repo contract. ## Verification - Focused verify/testmon suites updated for the reduced surface; deleted tests belonged exclusively to deleted authority. Quick gate at harvest. - Deliberate consequence: bare local `devtools verify --all` carries no host supervision — the governed route is the declared `verify_all` operation, as practiced. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
|
Codex review threads on this PR whose cited code is gone (checked against master at 23f91a5):
Resolving these threads. |
|
Closing out open Codex review threads on this PR (evidence checked against master at bf68918):
Resolving every thread listed; confirmed defects are fixed under the named bead. |
Summary
/tmpfallback while preserving explicit cloud-sandbox behaviorWhy
The prior shared scratch tree retained about 15.5 GB across runs and could not safely support tmpfs. A sampled recovery fixture was about 1.20 GB apparent/allocated with 1.12 GiB shared extents, so sparse-file assumptions were false and blindly copying fixtures would multiply storage. Managed per-run leases make cleanup deterministic without reducing test scope or fixture semantics.
The independent review found and fixed three high-severity lifecycle defects: interrupted runners could release a lease while pytest workers survived; concurrent stale cleanup could race PID reuse; and a missing NVMe root could silently spill onto
/tmptmpfs. It also bounded failure-artifact scanning/copying and made incomplete high-water scope explicit.Verification
pytest -q tests/unit/devtools/test_pytest_progress_plugin.py tests/unit/devtools/test_pytest_scratch.py tests/unit/devtools/test_run_tests.py tests/unit/devtools/test_verify.py— 66 passedpytest -q tests/unit/devtools/test_pytest_scratch.py— 11 passed after the type-safe test-double correctionThe complete 16-worker suite will run once on merged master so it covers this storage lifecycle together with the just-merged shared-Chrome work.
Storage contract
Ref:
polylogue-k1o3t.