From a404b1e676f145e32d98a6d6b17f927b3f91ee6b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 28 Sep 2016 23:13:19 -0400 Subject: [PATCH] Test fix: redirect python test subprocess output to /dev/null MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Redirecting to subprocess.PIPE can deadlock when subprocess.wait() is invoked. Signed-off-by: Jérémie Galarneau --- tests/regression/ust/exit-fast/test_exit-fast.py | 4 ++-- tests/regression/ust/libc-wrapper/test_libc-wrapper.py | 2 +- tests/regression/ust/linking/test_linking.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/regression/ust/exit-fast/test_exit-fast.py b/tests/regression/ust/exit-fast/test_exit-fast.py index 77261539a..4f498aed7 100644 --- a/tests/regression/ust/exit-fast/test_exit-fast.py +++ b/tests/regression/ust/exit-fast/test_exit-fast.py @@ -47,13 +47,13 @@ start_session(session_info) test_env = os.environ.copy() test_env["LTTNG_UST_REGISTER_TIMEOUT"] = "-1" -exit_fast_process = subprocess.Popen(test_path + "exit-fast", stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=test_env) +exit_fast_process = subprocess.Popen(test_path + "exit-fast", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, env=test_env) exit_fast_process.wait() print_test_result(exit_fast_process.returncode == 0, current_test, "Test application exited normally") current_test += 1 -exit_fast_process = subprocess.Popen([test_path + "exit-fast", "suicide"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=test_env) +exit_fast_process = subprocess.Popen([test_path + "exit-fast", "suicide"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, env=test_env) exit_fast_process.wait() stop_session(session_info) diff --git a/tests/regression/ust/libc-wrapper/test_libc-wrapper.py b/tests/regression/ust/libc-wrapper/test_libc-wrapper.py index 545d5662f..2870c81c1 100644 --- a/tests/regression/ust/libc-wrapper/test_libc-wrapper.py +++ b/tests/regression/ust/libc-wrapper/test_libc-wrapper.py @@ -42,7 +42,7 @@ session_info = create_session() enable_ust_tracepoint_event(session_info, "lttng_ust_libc*") start_session(session_info) -malloc_process = subprocess.Popen(test_path + "prog", stdout=subprocess.PIPE, stderr=subprocess.PIPE) +malloc_process = subprocess.Popen(test_path + "prog", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) malloc_process.wait() print_test_result(malloc_process.returncode == 0, current_test, "Test application exited normally") diff --git a/tests/regression/ust/linking/test_linking.py b/tests/regression/ust/linking/test_linking.py index 29128aa29..7400091e7 100644 --- a/tests/regression/ust/linking/test_linking.py +++ b/tests/regression/ust/linking/test_linking.py @@ -110,7 +110,7 @@ if DYNAMIC_TEST_ENABLED: start_session(session_info) # Dry run, no events should be logged - demo_process = subprocess.Popen(test_path + "demo", stdout=subprocess.PIPE, stderr=subprocess.PIPE) + demo_process = subprocess.Popen(test_path + "demo", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) demo_process.wait() stop_session(session_info) @@ -129,7 +129,7 @@ for executable in test_executables: enable_ust_tracepoint_event(session_info, "ust_tests_demo*") start_session(session_info) - demo_process = subprocess.Popen(executable, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + demo_process = subprocess.Popen(executable, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) demo_process.wait() stop_session(session_info) -- 2.34.1