refactor(tests): xdist is the standard runner; drop the per-file subprocess machinery

scripts/run_tests.sh now runs pytest-xdist -n <N> --dist loadfile as
the single canonical path on every OS (Linux and Windows CI lanes both
use it). The per-file subprocess model (run_tests_parallel.py, and the
interim run_xdist.sh experiment) is deleted along with its two
self-tests: persistent xdist workers pay the interpreter+import wall
once per worker instead of once per file (~0.5-1.5s x ~3400 files was
a ~6-minute floor on Windows), and --dist loadfile pins a file's tests
to ONE worker, bounding state pollution to co-scheduled files — which
is exactly the class of flake we are now committing to fix properly.

The serial process-killer quarantine phase is dropped too. It existed
to keep process-tree-sweep tests from killing sibling xdist workers;
the durable fix belongs in those tests (sweeps must target their own
children, not enumerate every python process), and keeping a
divergent two-phase path would hide that work.

Kept from the old wrapper: hermetic env -i scrubbing, Windows
location-var forwarding, venv probing, bytecode pre-compile,
-m 'not integration', and the HERMES_TEST_IMAGE docker-knob
allowlist. HERMES_TEST_FILE_TIMEOUT/FILE_RETRIES/SLICE go away with
the runner they parameterized; -j/HERMES_TEST_WORKERS now map to xdist
-n (Linux CI pins 96, Windows 32, default auto).

Docs updated to match: AGENTS.md (runner contract, flake policy,
isolation section), CONTRIBUTING.md, tests/conftest.py comments,
classify_changes docstring + its lane expectation (a .sh runner no
longer trips the supply-chain scan lane), comfyui README,
hermes-agent contributor guide, debugpy skill and its website doc.
This commit is contained in:
ethernet
2026-08-31 13:32:49 -04:00
parent c81c93e771
commit ef4a82eed0
20 changed files with 118 additions and 2021 deletions

View File

@@ -45,7 +45,7 @@ When you change a script:
The parent hermes-agent repo used to enable `pytest-xdist` by default
(`-n auto`); the canonical runner has since moved to per-file subprocess
isolation via `scripts/run_tests_parallel.py` and no longer uses xdist.
pytest-xdist with `--dist loadfile` via `scripts/run_tests.sh`.
This suite is small enough that parallelism isn't worth the complexity, and
pytest-xdist isn't always installed in the user's environment. The
`-c tests/pytest.ini -o addopts="-p no:xdist"` flags make the suite run