Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/test_fd_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ def test_child_stop_does_not_mute_parent(self):

def test_child_stop_leaks_no_control_bytes(self):
"""A foreign sentinel is swallowed, not teed or logged as output."""
from pluto import _fd_capture as fc

with capture_fd(2, logging.ERROR) as (cap, sm):
pid = os.fork()
if pid == 0:
Expand All @@ -176,6 +178,10 @@ def test_child_stop_leaks_no_control_bytes(self):
finally:
os._exit(0)
os.waitpid(pid, 0)
# Child stop() is a no-op off the owner pid, so it never writes a
# sentinel. Inject a foreign PID-tagged mark to exercise the
# reader path that must drop it without muting capture.
os.write(2, fc._stop_sentinel(pid))
time.sleep(0.3)

os.write(2, b'still here\n')
Expand Down
Loading