# HG changeset patch # User Pierre-Yves David # Date 2021-07-12 01:29:21 # Node ID d5fc1b59a2df21628a9ba719e61ef4ad380827c9 # Parent df6148ca712065b3957587656e97f7dbe34292d0 sigpipe-remote: verify the script is IO are unbuffered We don't want to get stuck anywhere by buffers. Differential Revision: https://phab.mercurial-scm.org/D11086 diff --git a/tests/testlib/sigpipe-remote.py b/tests/testlib/sigpipe-remote.py --- a/tests/testlib/sigpipe-remote.py +++ b/tests/testlib/sigpipe-remote.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 from __future__ import print_function +import io import os import subprocess import sys @@ -9,6 +10,10 @@ import time # we cannot use mercurial.testing as long as python2 is not dropped as the test will only install the mercurial module for python2 in python2 run +if isinstance(sys.stdout.buffer, io.BufferedWriter): + print('SIGPIPE-HELPER: script need unbuffered output', file=sys.stderr) + sys.exit(255) + DEBUG_FILE = os.environ.get('SIGPIPE_REMOTE_DEBUG_FILE') if DEBUG_FILE is None: debug_stream = sys.stderr.buffer