fix(dev): proc_start sends no Ctrl+C on Windows, so run_all.py runs to the end #2304

Merged
HumanBean merged 2 commits from mmkzero/Longshot:fix/windows-proc-start-ctrl-c into main 2026-11-23 00:33:32 +00:00
Contributor

Summary

On Windows, tests/run_all.py died part-way through without a word: no summary, no exit code, and the shell running it
went too. test_job_queue.py patches common.WINDOWS off to check the Linux paths, which took procs.proc_start to its
os.kill(pid, 0) fallback. On Windows signal 0 is CTRL_C_EVENT, so that call sent a Ctrl+C to every process of the
console. proc_start now checks the real platform before that fallback and reads the start time the Windows way.

To see it on main: python -I -B tests/run_all.py test_job_queue in a console on Windows; run_all.py and its shell end.

Read first: proc_start in scripts/devtools/procs.py, and the new WindowsConsole check in tests/test_job_queue.py.

Fixes #2303

Testing

Tested: Windows 11, Ryzen 9 7940HS, the builder's Python and llvm-mingw (dev.py env). The new check fails on main
3 of 3 runs ('ctrl-c' != 'quiet') and passes here 3 of 3; tests/test_job_queue.py passes whole (26 tests, 5 skipped
on Windows). The whole suite now runs to the end: 890 passed, 17 failed, 50 skipped in 333 s. The 17 fail on main too,
in the same environment (17 of 17): test_auto_handheld, test_crash_dialog, test_dev_ab, test_dev_build,
test_dev_migrate, test_dev_packs, test_finish_output, test_game_menu_mouse_buttons, test_input_movie,
test_linux_preflight, test_longshot_ctl, test_pads_after_menu, test_perf_report, test_pipeline_state_computes,
test_sampler_admission, test_saveload_warm_cache, test_sdiv_overflow.

Linux (Arch on WSL2, kernel 6.6.87, Python 3.14.10): python -I -B tests/test_job_queue.py passes here (26 tests, 6
skipped, the new check among them) as on main (25 tests, 5 skipped); the PosixTree checks all pass.

Still to test: None

Measurements

Verdict: the suite runs to the end on Windows; the new check fails on main and passes here.

Setup: Windows 11, Ryzen 9 7940HS, 16 checks at once; tests/run_all.py started from a console, as a player or
contributor would.

Before: main @ 753fb5af After: this PR @ 7e66aa6e
tests/run_all.py, whole suite dies about 270 results in, no summary 890 passed, 17 failed (all also on main), 50 skipped
test_job_queue.py WindowsConsole fails 3 of 3 passes 3 of 3

Risks

Windows only (os.name == "nt"), and only where a test patches common.WINDOWS off: Linux and macOS take the same
paths as before. Nothing changes for players. A revert is enough.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary On Windows, `tests/run_all.py` died part-way through without a word: no summary, no exit code, and the shell running it went too. `test_job_queue.py` patches `common.WINDOWS` off to check the Linux paths, which took `procs.proc_start` to its `os.kill(pid, 0)` fallback. On Windows signal 0 is `CTRL_C_EVENT`, so that call sent a Ctrl+C to every process of the console. `proc_start` now checks the real platform before that fallback and reads the start time the Windows way. To see it on main: `python -I -B tests/run_all.py test_job_queue` in a console on Windows; run_all.py and its shell end. Read first: `proc_start` in `scripts/devtools/procs.py`, and the new `WindowsConsole` check in `tests/test_job_queue.py`. Fixes #2303 ## Testing **Tested:** Windows 11, Ryzen 9 7940HS, the builder's Python and llvm-mingw (`dev.py env`). The new check fails on main 3 of 3 runs (`'ctrl-c' != 'quiet'`) and passes here 3 of 3; `tests/test_job_queue.py` passes whole (26 tests, 5 skipped on Windows). The whole suite now runs to the end: 890 passed, 17 failed, 50 skipped in 333 s. The 17 fail on main too, in the same environment (17 of 17): test_auto_handheld, test_crash_dialog, test_dev_ab, test_dev_build, test_dev_migrate, test_dev_packs, test_finish_output, test_game_menu_mouse_buttons, test_input_movie, test_linux_preflight, test_longshot_ctl, test_pads_after_menu, test_perf_report, test_pipeline_state_computes, test_sampler_admission, test_saveload_warm_cache, test_sdiv_overflow. Linux (Arch on WSL2, kernel 6.6.87, Python 3.14.10): `python -I -B tests/test_job_queue.py` passes here (26 tests, 6 skipped, the new check among them) as on main (25 tests, 5 skipped); the PosixTree checks all pass. **Still to test:** None ## Measurements **Verdict:** the suite runs to the end on Windows; the new check fails on main and passes here. Setup: Windows 11, Ryzen 9 7940HS, 16 checks at once; `tests/run_all.py` started from a console, as a player or contributor would. | | Before: main @ 753fb5af | After: this PR @ 7e66aa6e | |---|---|---| | `tests/run_all.py`, whole suite | dies about 270 results in, no summary | 890 passed, 17 failed (all also on main), 50 skipped | | `test_job_queue.py WindowsConsole` | fails 3 of 3 | passes 3 of 3 | ## Risks Windows only (`os.name == "nt"`), and only where a test patches `common.WINDOWS` off: Linux and macOS take the same paths as before. Nothing changes for players. A revert is enough. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
With common.WINDOWS patched off, as test_places_every_version_shares does, proc_start falls back to
os.kill(pid, 0). On Windows signal 0 is CTRL_C_EVENT: GenerateConsoleCtrlEvent sends a Ctrl+C to every
process of the console, so run_all.py and the shell running it end without a word.

The check runs the call in a python sharing the console of a second python that has a hidden console of
its own, and asks that one whether a Ctrl+C reached it. It fails on main.
fix(dev): proc_start never sends a Ctrl+C on Windows
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 4s
7e66aa6e77
The os.kill(pid, 0) fallback is for systems without /proc. On Windows, reached when a test patches
common.WINDOWS off, it is a Ctrl+C to the whole console. Check the real platform there and read the
start time through _win_start instead.
mmkzero changed title from WIP: fix(dev): proc_start sends no Ctrl+C on Windows, so run_all.py runs to the end to fix(dev): proc_start sends no Ctrl+C on Windows, so run_all.py runs to the end 2026-11-22 21:41:28 +00:00
HumanBean deleted branch fix/windows-proc-start-ctrl-c 2026-11-23 00:33:33 +00:00
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 4s
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
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.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2304
No description provided.