Repository navigation
fix(cli-lifecycle): the Windows pipe-leak check runs alone in its own process, so a sibling test's child cannot hold its writer (card 64ca188f) - #4556
Merged
Conversation
… process, so a sibling test's child cannot hold its writer (card 64ca188f) windows_launch::tests::detached_child_closes_unrelated_pipe_and_preserves_launch_contract makes an INHERITABLE pipe writer on purpose, to prove the detached child does not receive it. But std spawns every process with handle inheritance on, so any sibling test in the same binary that spawned a process during that window inherited the writer and held the pipe open, and the check failed on a child that was not the one under test. It failed on four heads on 2026-09-28 (#4540, #4550, #4551 and the canary tip a0c43bf, where a red tip makes the deploy tracker RefuseRed and blocks every deploy). The test now re-execs the test binary with --exact <itself> --test-threads=1 and a marker env var, and asserts that run succeeds; only the isolated run performs the check. Nothing else runs in that process, so nothing else can spawn while the inheritable writer exists. The check itself is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
This was referenced Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Card 64ca188f. This Windows flake is now blocking deploys.
The failure
continuum-cli-lifecyclewindows_launch::tests::detached_child_closes_unrelated_pipe_and_preserves_launch_contractfails intermittently atwindows_launch.rs:477with "the detached child retained the unrelated pipe writer" (left 1, right 0). On 2026-09-28 it hit four heads: #4540, #4550, #4551, and the canary tip a0c43bf. A red tip makes the deploy trackerRefuseRed, so no deploy reaches the nodes until a rerun happens to pass.The cause
The test makes an inheritable duplicate of a pipe writer on purpose, to prove
spawn_loggeddoes not pass unrelated inheritable handles to the detached child. The module's own header says why that matters: std'sCommand::spawninherits every inheritable handle. That same fact is what breaks the test.cargo testruns the crate's tests on parallel threads in one process, and when a sibling test spawns a process (the otherwindows_launchtests re-exec the binary as a fixture, and several tests shell out) while the inheritable writer exists, that child inherits the writer and keeps the pipe open. The check then fails because of a process that isn't the one under test. Fable pinned the concrete sibling:installer_failure_carries_powershell_diagnostics(supervisor_install.rs, cfg windows) spawnspowershell.exethree times through plain stdCommand, withbInheritHandles=TRUE.The fix
The test runs alone. In a normal run it re-execs the test binary with
--exact <itself> --test-threads=1and a marker env var (CONTINUUM_PIPE_LEAK_CHECK_ISOLATED), and asserts that run succeeds. Only the isolated run does the check, and since nothing else runs in that process, nothing can spawn during the window. The check itself, its fixture and its assertions are unchanged. The module already uses the same re-exec pattern for its fixture child.Evidence
This is Windows-only code (the module is
cfg(windows)), so the IntelMac can't compile it. The windows-msvc CI job compiles it and runs it. A single green run can't prove an intermittent failure gone, so the argument is the mechanism: the leak window now exists only in a process whose only test is this one. Please watch the next several Windows runs; a recurrence would mean the cause is elsewhere (for example, the fixture's own grandchild).🤖 Generated with Claude Code
https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE