hermes-bsd/scripts
Teknium f082b4ec5c
fix(ci): make parallel runner's exit-4 retry robust for newly-added test files (#42994)
The per-file test runner re-runs a file once when pytest exits 4 ("file or
directory not found") while the file exists on disk — a transient seen on
loaded shared CI runners where the planner collects a file (--collect-only
counts its tests) but the per-file subprocess fails to stat it moments later.

A single immediate retry could land in the same brief high-load window and
fail again, and the retry was gated on one Path.exists() check that can itself
be a flaky stat under that load — so a freshly-added test file that LPT pins to
one shard would deterministically red that shard on every run (no actual test
failure; the file just never executes).

- Extract the subprocess spawn/communicate/process-tree-kill logic into a
  shared _spawn_pytest_once() helper (removes ~90 lines of duplication between
  the primary run and the retry).
- Replace the single-shot retry with a bounded backoff loop
  (_EXIT4_RETRY_ATTEMPTS, escalating sleep) that re-runs while the file is
  present on disk.
- Add _file_present() which re-checks existence across a few spaced stats, so a
  single flaky negative stat doesn't wrongly conclude the file is missing. A
  genuinely-missing file (typo/deleted) still fails fast — exit 4 is not
  swallowed when the file truly does not exist.
- Tests: transient-then-pass recovery, genuinely-missing fails fast with no
  retry, give-up after max attempts, and _file_present transient/missing cases.
2026-06-09 21:39:09 -07:00
..
lib
tests
whatsapp-bridge
analyze_livetest.py
benchmark_browser_eval.py
build_model_catalog.py
build_skills_index.py
check-windows-footguns.py
check_subprocess_stdin.py
contributor_audit.py
discord-voice-doctor.py
docker_config_migrate.py
hermes-gateway
install.cmd
install.ps1
install.sh
install_psutil_android.py
keystroke_diagnostic.py
kill_modal.sh
lint_diff.py
LIVETEST_README.md
profile-tui.py
release.py
run_tests.sh
run_tests_parallel.py
sample_and_compress.py
setup_open_webui.sh
tool_search_livetest.py