Repository navigation
test: stop spawning POSIX binaries in two cases that run on Windows - #8713
Conversation
dev batch 43496185962 windows 5/14: process-control-graceful started its idle target with /bin/sleep, which does not exist on Windows (uv_spawn ENOENT). The runtime's own binary is the idle child now, as the same file's other helper already does; the case keeps guarding the forced-stop fallback, which on Windows is taskkill behind the same mayTerminate check. Letting mayTerminate allow the stop makes the case fail. windows 4/14: service-scheduler-restart-respawn-refusal (added in #8416) models the Windows host on a POSIX process model: the proxy is launched through /bin/sh so init reaps it, and a symlink named ocx supplies the command line ps reports. On Windows none of that exists and the stop path is the real Windows one, which is another test. Its cases now run off Windows only, with the reason and the Windows coverage of the same decisions (service-scheduler-restart-cleanup and windows-stop-callers, both green on that run's Windows shards) in the file.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Maintainer judgment: integrating into Exact head af6485a:
Test-only change; no outstanding maintainer change requests and no security-boundary surface. |
Summary
Two Windows failures from dev batch 43496185962. Both test files were added in #8416 and spawn POSIX binaries that do not exist on Windows (
uv_spawn ... ENOENT).windows 5/14,
tests/lib/process-control-graceful.test.ts"stopProxyGracefully > a refused mayTerminate keeps the forced-stop fallback from signalling the process" started its throwaway target with/bin/sleep 30. The behaviour it guards is platform-independent: on Windows the forced fallback istaskkill /T /Fbehind the samemayTerminatecheck (killProxyinsrc/lib/process-control.ts). The idle child is now the runtime's own binary (process.execPath -e "setTimeout(...)"), as the file's other helper already does, so the case runs on Windows too. LettingmayTerminateallow the stop makes it fail.windows 4/14,
tests/service/service-scheduler-restart-respawn-refusal.test.ts(9 cases, 11 results). This file models a Windows scheduler restart on a POSIX process model by design. The Windows host is a fixture:repairService({ platform: "win32" }), and the proxy child pinsprocess.platformto win32 for its own branch selection. The process lifecycle under that is POSIX on purpose. The proxy is launched through/bin/sh -c '... &'so init reaps it (a zombie child would still answerkill(0)whilestopProxyblocks the event loop inAtomics.wait). A symlink namedocxsupplies the command line thatverifyPidIdentityreads throughps. On a real Windows host there is no/bin/sh, and the stop runs the real Windows path (CIM command-line identity,taskkill), which makes it a different test that cannot be validated before a Windows batch. Its cases now run off Windows only (posixHostTest = test.skipIf(process.platform === "win32")). The reason is written in the file, together with the tests that cover the same decisions on Windows:tests/service/service-scheduler-restart-cleanup.test.ts: repairService on arespawnable_servicerefusal and the restart receipt, hermetic, every platform. 27 cases passed on windows 3/14 of the same run.tests/windows/windows-stop-callers.test.ts: the Windows/api/stoproute and the checked service stop. 32 cases passed on windows 12/14 of the same run.These cover the same decisions through seams and are partial coverage, not an end-to-end replacement: Windows CI no longer has this file's integrated proof that the real management route accepts a matching receipt, rejects a foreign one, and settles restart recovery against a live proxy. A native Windows integration test (direct child, Windows identity and taskkill paths) is a worthwhile follow-up. On Linux and macOS the file still runs every case.
Verification
bun test tests/lib/process-control-graceful.test.ts: 33 pass / 0 fail. WithmayTerminate: () => truethe guarded case fails.bun test tests/service/service-scheduler-restart-respawn-refusal.test.ts: 11 pass / 0 fail on macOS.bun run typecheck: exit 0.Checklist
Summary by CodeRabbit