Repository navigation
Fix test harness resource and I/O stall handling - #3940
Conversation
📝 WalkthroughWalkthroughPytest verification now validates basetemp capacity, reports xdist worker states, and terminates runs after sustained all-worker uninterruptible stalls. Tests cover timeout classification and tmpfs fallback. ChangesPytest runtime supervision
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Heartbeat as _run_pytest_with_heartbeat
participant Sampler as resource sampling
participant Classifier as xdist_uninterruptible_stall_reason
Heartbeat->>Sampler: sample xdist worker states
Sampler-->>Heartbeat: all_workers_uninterruptible metrics
Heartbeat->>Classifier: classify worker state duration
Classifier-->>Heartbeat: stall reason or None
Heartbeat->>Heartbeat: terminate run when stall reason is returned
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@devtools/verify_runs.py`:
- Around line 701-709: Update pytest_basetemp_required_kb to reject negative
parsed values instead of clamping them to zero. Validate the integer before
converting megabytes to kilobytes, and raise PytestResourceError using the
existing invalid-environment-value message for values below zero while
preserving the current handling of empty and valid nonnegative values.
- Around line 790-799: Update the tmpfs admission calculation in the
candidate-selection flow around pytest_tmpfs_budget_kb so min_free_kb is not
added to the declared demand twice. Keep normal headroom separate from the
selected-root requirement, and choose the declared required_kb whenever it is
present, including zero, rather than using truthiness-based fallback to
budget_kb or 0.
In `@devtools/verify.py`:
- Around line 1380-1391: Reorder the loop’s xdist resource sampling and
classification around the generic output/progress timeout logic so
xdist_uninterruptible_stall_reason can complete its interval first.
Alternatively, defer the generic progress_idle termination while
xdist_uninterruptible_since is active, ensuring termination_reason preserves the
typed xdist SQLite/filesystem stall classification.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 7963d9a9-021a-4fba-946a-847acb1a2e33
📒 Files selected for processing (4)
devtools/verify.pydevtools/verify_runs.pytests/unit/devtools/test_verify.pytests/unit/test_pytest_temp_policy.py
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 29fe89d7c3
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1833a29571
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4d8e9b0bd
ℹ️ 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 - record the verified portion of the test-harness resource-admission work - preserve the exact evidence, residual successors, and Beads snapshot in the authoritative JSONL ## Problem PR #3940 delivered the core fail-safe harness. Exact-head review then found residual scope in automatic pre-execution reroute and the controlled xdist stall fixture, so the parent Bead remains open with named successors. ## Solution Record a partial disposition for `polylogue-9pf58`: crash-left seeded-build recovery is complete and tested; automatic reroute and the six-worker xdist acceptance fixture remain on `polylogue-enl3l` and `polylogue-7wytz`. The related base-authority Bead remains open. ## Verification - `devtools lab policy bead-graph --json` — zero unhandled findings; two explicitly deferred operator-action missing-AC records remain - Beads pre-push JSONL/dependency validation — passed <!-- polylogue-pr-scope:v1 { "assigned_beads": [ "polylogue-9pf58" ], "beads_digest": "134cf7356763f8315cea631a17b9c3beb3d9c5682cf45e16af625a6a4f016cfd", "dispositions": [ { "bead_id": "polylogue-9pf58", "disposition": "partial", "evidence": [ { "kind": "commit", "ref": "12618c007 (merged PR #3940)" }, { "kind": "commit", "ref": "9c2e215dca3d4fc2f6d6bc0f255013af532533a0" }, { "kind": "test", "ref": "devtools test tests/unit/infra/test_workload_artifacts.py: 9 passed" }, { "kind": "test", "ref": "devtools test tests/unit/devtools/test_verify.py -k xdist/resource: 3 passed" }, { "kind": "command", "ref": "devtools verify --quick: 25/25 steps passed" } ], "successors": [ "polylogue-7wytz" ] } ], "head_sha": "2dc7bf01ffc3450a7219e59c834529b2623d4333", "scope_digest": "2cf55e2bf014618681268fffd265608627a0efc7da67c7dc498419c5819a494b", "version": 1 } --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated project tracking records to document completed verification for resource handling, cleanup, recovery, run receipts, stall termination, release safeguards, and dependency pull request scope. * Clarified the relationship between automated dependency checks and the broader pull request scope validation work. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Problem
The full suite previously left all xdist workers in D-state SQLite/filesystem sleep without the supervisor classifying the run, and a tmpfs run could be selected with only the run budget plus no safety margin. Dependabot PRs also failed before verification because human Bead carriers were required for dependency-only changes.
Solution
The managed pytest sampler records xdist worker state and the supervisor terminates only after every observed worker remains uninterruptible for the configured stall interval. Tmpfs admission now requires the bounded run budget plus normal free-space headroom; otherwise the NVMe scratch root is selected. The PR-scope checker accepts only authoritative
dependabot[bot]metadata with an exact dependency-only file allowlist; ordinary PRs retain the carrier gate.Verification
direnv exec . devtools test tests/unit/test_pytest_temp_policy.py tests/unit/devtools/test_verify.py -k 'xdist_uninterruptible or managed_pytest_temp_root or resource_sampler'— 10 passeddirenv exec . devtools test tests/unit/devtools/test_pr_scope.py tests/unit/devtools/test_testmon_bootstrap.py -k 'dependabot or automated_scope or bootstrap or seed'— 26 passeddirenv exec . devtools test tests/unit/devtools/test_pr_scope.py— 25 passeddirenv exec . devtools verify --quick— exit 0; all 25 non-test steps passedRef #9pf58