Revert Popen bufsize to Python 2.7 default value.
This might be the reason causing the process to not terminate.
This CL adds also more logging.
No-Presubmit: True
Bug: webrtc:13607
Change-Id: I9fc2cf39d2c1df92670b45dd081022ce69068836
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250181
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35885}
diff --git a/audio/test/low_bandwidth_audio_test.py b/audio/test/low_bandwidth_audio_test.py
index 96b2be3..107ebbf 100755
--- a/audio/test/low_bandwidth_audio_test.py
+++ b/audio/test/low_bandwidth_audio_test.py
@@ -177,14 +177,19 @@
# Need to provide paths in the current directory due to a bug in PESQ:
# On Mac, for some 'path/to/file.wav', if 'file.wav' is longer than
# 'path/to', PESQ crashes.
+ # The bufsize is set to 0 to keep the default Python 2.7 behaviour (it
+ # changed to -1 in Python >3.3.1 but this is causing issues).
process = subprocess.Popen(_LogCommand(command),
+ bufsize=0,
cwd=directory,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
try:
+ logging.info('Waiting for termination ...')
out, err = process.communicate(timeout=120)
except TimeoutExpired:
+ logging.error('Timeout, killing the process.')
process.kill()
out, err = process.communicate()