Test fix: redirect python test subprocess output to /dev/null
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 29 Sep 2016 03:13:19 +0000 (23:13 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 3 Oct 2016 16:07:38 +0000 (12:07 -0400)
Redirecting to subprocess.PIPE can deadlock when subprocess.wait()
is invoked.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/ust/exit-fast/test_exit-fast.py
tests/regression/ust/libc-wrapper/test_libc-wrapper.py
tests/regression/ust/linking/test_linking.py

index 77261539a439316acefc309792c11571e14a8581..4f498aed7ed669744f73838afab1c61c6cd34674 100644 (file)
@@ -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)
index 545d5662f3030ef64d2e7880f984c6f855a55328..2870c81c1e47b743a6923aa742df3bc7115fc9d8 100644 (file)
@@ -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")
index 29128aa29d047266422dac520f4123393a5a519b..7400091e77fc03b3eaf506bb6356e90db36b798c 100644 (file)
@@ -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)
 
This page took 0.026968 seconds and 4 git commands to generate.