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>
Thu, 29 Sep 2016 04:05:09 +0000 (00:05 -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/baddr-statedump/test_baddr-statedump.py
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
tests/regression/ust/type-declarations/test_type_declarations.py
tests/regression/ust/ust-dl/test_ust-dl.py

index 53f9dedd844ca0581a490b7209ac7b7965263197..6df0575d85430e4367956936d044c242e30967f3 100644 (file)
@@ -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")
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)
 
index da2f57987f7aa40818fb25b5de66b111730b34f0..45394c9a6f4e9363819abf6b4dd19f461d304a24 100644 (file)
@@ -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")
index 22c1dca8de1ead15cd6520512225bb21d5556bf8..81972a7db90e8ce57ffc6dd35e38a32188fd8e90 100644 (file)
@@ -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()
 
This page took 0.029774 seconds and 5 git commands to generate.