From d5f98ce8cfcd561b4ee0023ad5a33e88822be78b Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Wed, 2 Feb 2022 13:41:13 +0100 Subject: [PATCH] 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 Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/main@{#35885} --- audio/test/low_bandwidth_audio_test.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/audio/test/low_bandwidth_audio_test.py b/audio/test/low_bandwidth_audio_test.py index 96b2be3fe9..107ebbf3f7 100755 --- a/audio/test/low_bandwidth_audio_test.py +++ b/audio/test/low_bandwidth_audio_test.py @@ -177,14 +177,19 @@ def _RunPesq(executable_path, # 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()