Skip to content

Commit 57271c2

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 ad9c115 commit 57271c2

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
@@ -436,14 +436,18 @@ async def test_a_refused_claim_releases_the_stream_it_already_took(
436436

437437

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

0 commit comments

Comments
 (0)