Repository navigation
test: stabilize devtools verify --all under xdist load - #1803
Conversation
## Problem `devtools verify --all` ran the entire non-integration suite in one `-n 16` xdist pool. Several wall-clock-bound and Hypothesis-deadline-bound tests failed intermittently under worker contention while exact reruns of the failed nodes passed (#1775), making `--all` an unreliable completion gate. The flakes split into two physical causes: - per-example wall time dominated by xdist scheduling jitter, not algorithmic cost, blowing past Hypothesis's implicit 200ms deadline (property tests in test_schema_privacy / test_null_guard_properties / test_machine_contract had no per-test deadline override); - timing budgets, loopback-socket timeouts, and TUI render timing measuring elapsed wall time that balloons under 16-worker contention. ## Solution Two-pronged, matching the issue's acceptance criteria: 1. Hypothesis `default`/`ci` profiles set `deadline=None` and suppress `HealthCheck.too_slow`. Real perf regressions are caught by the dedicated TestPerformanceBudget / benchmark tests, not Hypothesis per-example timing. This is a global fix — future property tests cannot regress into the same load-dependent deadline flake. 2. New `load_sensitive` marker on the wall-clock-bound classes (TestPerformanceBudget, the FTS-trigger amplification timing tests, the daemon web-reader diagnostic-socket class). `devtools verify --all` now runs two lanes: a parallel bulk lane (`-n 16`, deselecting `load_sensitive`/`tui`) and an isolated lane (`-n 0 -p no:randomly`) that reruns the timing-sensitive and TUI tests single-process with a stable order. Both lanes are correctness blockers; the split only removes the scheduling jitter. The isolated lane writes its own report artifacts so the bulk lane's regression-comparison signal is preserved. ## Verification - `build_verify_steps(full_pytest=True)` emits the two expected lanes with the correct `-m` expressions and worker counts. - Lane partition: 25 isolated-lane tests collected (load_sensitive + tui), the named flaky perf/socket tests captured, zero overlap with the bulk lane, marker registered (no PytestUnknownMarkWarning). - Isolated lane single-process: `24 passed, 10532 deselected in 27.25s`. - Previously-flaky property tests under the new profile: `3 passed`. - `mypy --strict devtools/verify.py`: clean. `devtools render-all --check`: no committed-doc drift. Closes #1775 Co-Authored-By: Claude <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR stabilizes ChangesTest Isolation and Xdist Load Stabilization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 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 |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
devtools verify --allis now a reliable completion gate: a parallel bulk laneplus an isolated single-process lane for wall-clock-bound tests, with the
Hypothesis profiles calibrated so per-example timing no longer flakes under
xdist worker contention.
Problem
devtools verify --allran the whole non-integration suite in one-n 16xdist pool. Load-sensitive tests failed intermittently while exact reruns of
the failed nodes passed (#1775). Two physical causes:
test_schema_privacy,test_null_guard_properties, andtest_machine_contracthad no per-testdeadline override, so they inherited Hypothesis's implicit 200ms deadline.
Under 16-worker contention, per-example wall time is dominated by scheduling
jitter, not algorithmic cost, and blows past 200ms.
TestPerformanceBudget, the FTS-triggeramplification timing tests, the daemon web-reader loopback-socket diagnostic
test, and the TUI render tests measure elapsed wall time that balloons under
worker pressure.
Solution
Hypothesis
default/ciprofiles setdeadline=Noneand suppressHealthCheck.too_slow. Real perf regressions are caught by the dedicatedTestPerformanceBudget/ benchmark tests, not Hypothesis per-exampletiming. Global fix — future property tests can't regress into the same
load-dependent deadline flake.
load_sensitivemarker on the wall-clock-bound classes.verify --allnow runs two lanes:
-n 16):... and not load_sensitive and not tui-n 0 -p no:randomly):... and (load_sensitive or tui),single-process with a stable order. Writes its own report artifacts so
the bulk lane's
_compare_against_lastregression signal is preserved.Both lanes are correctness blockers; the split only removes scheduling
jitter. Step names (
pytest full (parallel)/pytest load-sensitive (isolated)) make the timing-sensitive lane explicit (AC5).Verification
build_verify_steps(full_pytest=True)emits the two expected lanes with thecorrect
-mexpressions and worker counts.perf/socket tests captured, zero overlap with the bulk lane, marker
registered (no
PytestUnknownMarkWarning).24 passed, 10532 deselected in 27.25s.3 passed in 2.15s.mypy --strict devtools/verify.py: clean.devtools render-all --check: nocommitted-doc drift. Pre-push static gate: all green.
Closes #1775
Summary by CodeRabbit