Skip to content

Commit 84f033d

Browse files
committed
Scope the stderr-closed isolation test to POSIX
The wire duplicate is allocated above the standard range atomically only via F_DUPFD; Windows has no atomic minfd dup, so with fd 2 closed the duplicate can land in the hole and the transport degrades to serving in place. That degradation is safe, but it leaves fd 0 on the planted pipe, and the test's blocking read of it then never returns on Windows. No-Verification-Needed: test-only platform scoping
1 parent a33d31c commit 84f033d

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

tests/server/test_stdio.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,14 +435,18 @@ async def test_a_refused_claim_releases_the_stream_it_already_took(
435435

436436

437437
@pytest.mark.anyio
438-
async def test_the_claim_engages_even_when_stderr_is_closed(
438+
@pytest.mark.skipif(sys.platform == "win32", reason="atomic above-range dup is POSIX-only (F_DUPFD)")
439+
async def test_the_claim_engages_even_when_stderr_is_closed( # pragma: lax no cover
439440
monkeypatch: pytest.MonkeyPatch,
440441
) -> None:
441-
"""A process missing fd 2 still gets full isolation.
442-
443-
SDK-defined behavior: the wire duplicate is allocated above the standard range
444-
atomically, so a hole in the descriptor table cannot capture it; the stdout
445-
diversion falls back to the null device.
442+
"""A process missing fd 2 still gets full isolation on POSIX.
443+
444+
F_DUPFD allocates the wire duplicate above the standard range atomically, so
445+
the hole in slot 2 cannot capture it; the stdout diversion falls back to the
446+
null device. Windows has no atomic minfd dup: the duplicate can land in the
447+
hole and the transport degrades to serving in place (a documented residue),
448+
which is safe but not this test's isolation contract, and this test's blocking
449+
read of the still-piped fd 0 would then never return.
446450
"""
447451
request = JSONRPCRequest(jsonrpc="2.0", id=1, method="ping")
448452
response = JSONRPCResponse(jsonrpc="2.0", id=1, result={})

0 commit comments

Comments
 (0)