From: Jérémie Galarneau Date: Thu, 29 Sep 2016 03:13:19 +0000 (-0400) Subject: Test fix: redirect python test subprocess output to /dev/null X-Git-Tag: v2.8.2~19 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=fe4ae474583a1d1f8a97b38984480464d4f25435;p=lttng-tools.git Test fix: redirect python test subprocess output to /dev/null Redirecting to subprocess.PIPE can deadlock when subprocess.wait() is invoked. Signed-off-by: Jérémie Galarneau --- diff --git a/tests/regression/ust/baddr-statedump/test_baddr-statedump.py b/tests/regression/ust/baddr-statedump/test_baddr-statedump.py index 53f9dedd8..6df0575d8 100644 --- a/tests/regression/ust/baddr-statedump/test_baddr-statedump.py +++ b/tests/regression/ust/baddr-statedump/test_baddr-statedump.py @@ -45,7 +45,7 @@ session_info = create_session() enable_ust_tracepoint_event(session_info, "*") start_session(session_info) -test_process = subprocess.Popen(test_path + "prog.strip", stdout=subprocess.PIPE, stderr=subprocess.PIPE) +test_process = subprocess.Popen(test_path + "prog.strip", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) test_process.wait() print_test_result(test_process.returncode == 0, current_test, "Test application exited normally") 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) diff --git a/tests/regression/ust/type-declarations/test_type_declarations.py b/tests/regression/ust/type-declarations/test_type_declarations.py index b2fa282a1..6a2278ecb 100644 --- a/tests/regression/ust/type-declarations/test_type_declarations.py +++ b/tests/regression/ust/type-declarations/test_type_declarations.py @@ -44,7 +44,7 @@ start_session(session_info) test_env = os.environ.copy() test_env["LTTNG_UST_REGISTER_TIMEOUT"] = "-1" -td_process = subprocess.Popen(test_path + "type-declarations", stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=test_env) +td_process = subprocess.Popen(test_path + "type-declarations", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, env=test_env) td_process.wait() print_test_result(td_process.returncode == 0, current_test, "Test application exited normally") diff --git a/tests/regression/ust/ust-dl/test_ust-dl.py b/tests/regression/ust/ust-dl/test_ust-dl.py index d9bc60a75..41d197c0c 100644 --- a/tests/regression/ust/ust-dl/test_ust-dl.py +++ b/tests/regression/ust/ust-dl/test_ust-dl.py @@ -49,7 +49,7 @@ test_env = os.environ.copy() test_env["LD_PRELOAD"] = test_env.get("LD_PRELOAD", "") + ":liblttng-ust-dl.so" test_env["LD_LIBRARY_PATH"] = test_env.get("LD_LIBRARY_PATH", "") + ":" + test_path test_process = subprocess.Popen(test_path + "prog", - stdout=subprocess.PIPE, stderr=subprocess.PIPE, + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, env=test_env) test_process.wait()