From 614ad602bc1f895dad8eaa001a69a4211c5459d2 Mon Sep 17 00:00:00 2001 From: Alex Ozdemir Date: Mon, 20 Jul 2020 13:21:06 -0700 Subject: [PATCH] Fix a deadlock in the signature tests. (#4772) * wait() deadlocks if the OS pipe fills * communicate() does not This is essentially a duplicate of [this](https://github.com/CVC4/LFSC/pull/38). --- test/signatures/run_test.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/signatures/run_test.py b/test/signatures/run_test.py index ac14267e9..df612e20a 100755 --- a/test/signatures/run_test.py +++ b/test/signatures/run_test.py @@ -111,12 +111,11 @@ def main(): result = subprocess.Popen(cmd, stderr=subprocess.STDOUT, stdout=subprocess.PIPE) - code = result.wait() - if 0 != code: - stdout = result.stdout.read() + (stdout, _) = result.communicate() + if 0 != result.returncode: if stdout: print(stdout.decode()) - return code + return result.returncode if __name__ == '__main__': -- 2.30.2