tooling: pin failure reporting in run_checks_parallel_check #1820

Merged
Asimmimx merged 1 commit from upstream-pr/1827 into main 2026-11-24 19:32:11 +00:00
Asimmimx commented 2026-11-24 19:18:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Asimmimx on 2026-11-24T19:18:46Z.


Change

tests/run_checks_parallel_check.py covered the pass/fail split and output order of tools/run_checks_parallel.py, but its only failing fixture exits with 3 and writes to stdout. A check that fails the usual way (an uncaught assert, exit 1, traceback on stderr) was not exercised, and nothing read the group headers, the ::endgroup:: lines, the FAILED: list beyond its first entry, the summary count or the -j clamp. A runner that reported an exit-1 script as ok, or dropped its traceback, passed the check.

Single-point mutants of the runner, applied one at a time and reverted:

Mutant Existing check With the new cases
M1 drop stderr=subprocess.STDOUT (traceback leaves the group) survived killed
M2 header says exit without the code survived killed
M3 header label 'ok' if code != 1 survived killed
M4 FAILED: keeps only the first failing script survived killed
M5 drop print("::endgroup::") survived killed
M6 summary count len(args.scripts) - 1 survived killed
M7 max_workers=args.jobs (no clamp of -j 0) survived killed
M8 return len(failed) instead of return 1 survived killed
M9 ::endgroup:: printed before the script output survived killed
M10 failure test code > 1 (exit 1 counted as a pass) survived killed
M11 child started without -B survived killed
M12 if failed: never taken killed killed

The new cases read:

  • a third fixture fail.py (assert False, 'fail ran') that exits 1 and writes its traceback to stderr;
  • run(bad, fail, good): exit status 1; the line FAILED: <bad> <fail> in the given order; headers (exit 3, , (exit 1, and (ok, ; bad ran, AssertionError: fail ran and good ran each between its own header and the next ::endgroup::; three ::endgroup:: lines;
  • run(good, good) prints all 2 checks passed;
  • -j 0 runs one script and prints all 1 checks passed (the runner clamps it to one worker; without the clamp ThreadPoolExecutor(max_workers=0) raises);
  • good.py asserts sys.flags.dont_write_bytecode, which the usage line promises (python -B <script>).

Only the check file changes.

Verification

Based on origin/main 813045b3c1. Windows 11 Pro 26300.9974, Python 3.12.10.

> python -B tests/run_checks_parallel_check.py
run_checks_parallel_check: ok
> python -B tests/docs_links_check.py
Self-test passed.
Checked 18 Markdown files and 369 links.
> python -B tests/bidi_controls_check.py
Self-test passed.
Checked 1320 tracked source, script and build/CI files: no bidirectional controls.

Each mutant in the table was applied by hand to tools/run_checks_parallel.py, followed by python -B tests/run_checks_parallel_check.py, then reverted. All twelve fail with the new check; on the unmodified runner it passes.

Evidence and follow-up

The fixtures are three one-line Python scripts written to a temporary directory by the check itself. The -B assertion passes trivially when PYTHONDONTWRITEBYTECODE is set in the environment; it then just does not detect M11. The tool is not changed.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed. (No capability or requirement changed.)
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6589537759 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1827). Originally posted by [Asimmimx](https://github.com/Asimmimx) on 2026-11-24T19:18:46Z. --- ## Change `tests/run_checks_parallel_check.py` covered the pass/fail split and output order of `tools/run_checks_parallel.py`, but its only failing fixture exits with 3 and writes to stdout. A check that fails the usual way (an uncaught `assert`, exit 1, traceback on stderr) was not exercised, and nothing read the group headers, the `::endgroup::` lines, the `FAILED:` list beyond its first entry, the summary count or the `-j` clamp. A runner that reported an exit-1 script as `ok`, or dropped its traceback, passed the check. Single-point mutants of the runner, applied one at a time and reverted: | Mutant | Existing check | With the new cases | |---|---|---| | M1 drop `stderr=subprocess.STDOUT` (traceback leaves the group) | survived | killed | | M2 header says `exit` without the code | survived | killed | | M3 header label `'ok' if code != 1` | survived | killed | | M4 `FAILED:` keeps only the first failing script | survived | killed | | M5 drop `print("::endgroup::")` | survived | killed | | M6 summary count `len(args.scripts) - 1` | survived | killed | | M7 `max_workers=args.jobs` (no clamp of `-j 0`) | survived | killed | | M8 `return len(failed)` instead of `return 1` | survived | killed | | M9 `::endgroup::` printed before the script output | survived | killed | | M10 failure test `code > 1` (exit 1 counted as a pass) | survived | killed | | M11 child started without `-B` | survived | killed | | M12 `if failed:` never taken | killed | killed | The new cases read: - a third fixture `fail.py` (`assert False, 'fail ran'`) that exits 1 and writes its traceback to stderr; - `run(bad, fail, good)`: exit status 1; the line `FAILED: <bad> <fail>` in the given order; headers `(exit 3, `, `(exit 1, ` and `(ok, `; `bad ran`, `AssertionError: fail ran` and `good ran` each between its own header and the next `::endgroup::`; three `::endgroup::` lines; - `run(good, good)` prints `all 2 checks passed`; - `-j 0` runs one script and prints `all 1 checks passed` (the runner clamps it to one worker; without the clamp `ThreadPoolExecutor(max_workers=0)` raises); - `good.py` asserts `sys.flags.dont_write_bytecode`, which the usage line promises (`python -B <script>`). Only the check file changes. ## Verification Based on `origin/main` 813045b3c13f7bad20d8577557b621ee869ccbba. Windows 11 Pro 26300.9974, Python 3.12.10. ```text > python -B tests/run_checks_parallel_check.py run_checks_parallel_check: ok > python -B tests/docs_links_check.py Self-test passed. Checked 18 Markdown files and 369 links. > python -B tests/bidi_controls_check.py Self-test passed. Checked 1320 tracked source, script and build/CI files: no bidirectional controls. ``` Each mutant in the table was applied by hand to `tools/run_checks_parallel.py`, followed by `python -B tests/run_checks_parallel_check.py`, then reverted. All twelve fail with the new check; on the unmodified runner it passes. ## Evidence and follow-up The fixtures are three one-line Python scripts written to a temporary directory by the check itself. The `-B` assertion passes trivially when `PYTHONDONTWRITEBYTECODE` is set in the environment; it then just does not detect M11. The tool is not changed. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [ ] I updated README/docs when a capability or build requirement changed. (No capability or requirement changed.) - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted (Claude Code).
upstream-sync closed this pull request 2026-11-24 20:00:50 +00:00
tedin7 commented 2026-11-24 20:00:50 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T19:31:36Z.

Review: COMMENTED


Reviewed at commit 9b5ec25bde3cf2d52f00d05b4f64d2812f6089e5 (no P1/P2 defects found).

Verification

  • Linux checks:
    • git diff --check origin/main...HEAD: pass
    • python -B tests/bidi_controls_check.py: pass (Checked 1320 tracked source, script and build/CI files: no bidirectional controls.)
    • python -B tests/run_checks_parallel_check.py: pass (run_checks_parallel_check: ok)
  • Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
    • Windows Python checks: tests/run_checks_parallel_check.py ok (0.6s, pure-Python tooling check with no C++ build targets; Debug/Release /O2 N/A)
  • Local mutation checks (python -B tests/run_checks_parallel_check.py on mutated tools/run_checks_parallel.py, then restored cleanly):
    • Removed max(1, args.jobs) clamp in main -> failed as expected on -j 0 (rc=1)
    • Dropped -B flag from run_one subprocess command -> failed as expected on sys.flags.dont_write_bytecode assertion (rc=1)

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6045971631 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1827#pullrequestreview-6045971631). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T19:31:36Z. **Review:** COMMENTED --- Reviewed at commit `9b5ec25bde3cf2d52f00d05b4f64d2812f6089e5` (no P1/P2 defects found). ### Verification - **Linux checks**: - `git diff --check origin/main...HEAD`: pass - `python -B tests/bidi_controls_check.py`: pass (`Checked 1320 tracked source, script and build/CI files: no bidirectional controls.`) - `python -B tests/run_checks_parallel_check.py`: pass (`run_checks_parallel_check: ok`) - **Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)**: - **Windows Python checks**: `tests/run_checks_parallel_check.py` ok (`0.6s`, pure-Python tooling check with no C++ build targets; Debug/Release `/O2` N/A) - **Local mutation checks** (`python -B tests/run_checks_parallel_check.py` on mutated `tools/run_checks_parallel.py`, then restored cleanly): - Removed `max(1, args.jobs)` clamp in `main` -> failed as expected on `-j 0` (`rc=1`) - Dropped `-B` flag from `run_one` subprocess command -> failed as expected on `sys.flags.dont_write_bytecode` assertion (`rc=1`) AI-assisted; commands listed were executed locally.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!1820
No description provided.