mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-10 03:53:56 -06: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,
|
[sys.executable, "scripts/verify.py", "--list-emulators"], cwd=ROOT,
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
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.readline()
|
||||||
proc.stdout.close()
|
proc.stdout.close()
|
||||||
_, err = proc.communicate(timeout=120)
|
_, err = proc.communicate(timeout=120)
|
||||||
|
|||||||
Reference in new issue
Block a user