mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-18 09:23:26 -05:00
fix: make the closed-pipe test meet a full pipe
This commit is contained in:
1 parent
7310f9ad54
commit
ebf44d523b
1 file changed
+9
@@ -3839,6 +3839,15 @@ class AReaderThatLeavesEarlyIsNoCrash(unittest.TestCase):
|
||||
[sys.executable, "scripts/verify.py", "--list-emulators"], cwd=ROOT,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||
)
|
||||
# The listing fits a 64 KiB pipe: a child that wrote it all before
|
||||
# the close below never met the broken pipe and exited 0. A 4 KiB
|
||||
# pipe keeps it writing when the reader leaves.
|
||||
try:
|
||||
import fcntl # noqa: PLC0415
|
||||
|
||||
fcntl.fcntl(proc.stdout.fileno(), fcntl.F_SETPIPE_SZ, 4096)
|
||||
except (ImportError, AttributeError, OSError):
|
||||
pass
|
||||
proc.stdout.readline()
|
||||
proc.stdout.close()
|
||||
_, err = proc.communicate(timeout=120)
|
||||
|
||||
Reference in new issue
Block a user