Tests: eliminate process timeouts from Python tests
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 5 Jul 2016 19:13:15 +0000 (15:13 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 5 Jul 2016 19:18:28 +0000 (15:18 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/ust/baddr-statedump/test_baddr-statedump.py
tests/regression/ust/daemon/test_daemon.py
tests/regression/ust/exit-fast/test_exit-fast.py
tests/regression/ust/fork/test_fork.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 723eb1ba6ba2c4c234157921873f4c87924ccf33..53f9dedd844ca0581a490b7209ac7b7965263197 100644 (file)
@@ -46,14 +46,7 @@ enable_ust_tracepoint_event(session_info, "*")
 start_session(session_info)
 
 test_process = subprocess.Popen(test_path + "prog.strip", stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-if sys.version_info >= (3, 3):
-    try:
-        test_process.wait(5)
-    except subprocess.TimeoutExpired:
-        test_process.kill()
-        bail("Failed to run ust baddr-statedump test application.", session_info)
-else:
-    test_process.wait()
+test_process.wait()
 
 print_test_result(test_process.returncode == 0, current_test, "Test application exited normally")
 current_test += 1
index 70afe3ce313f9635fd0d43cc89ec1d45f5ef2b17..d85f955216dfb686ed5b75b8600f045c3db2a567 100644 (file)
@@ -44,14 +44,7 @@ enable_ust_tracepoint_event(session_info, "*")
 start_session(session_info)
 
 daemon_process = subprocess.Popen(test_path + "daemon", stdout=subprocess.PIPE)
-if sys.version_info >= (3, 3):
-    try:
-        daemon_process_return_code = daemon_process.wait(5)
-    except subprocess.TimeoutExpired:
-        daemon_process.kill()
-        daemon_process_return_code = -1
-else:
-    daemon_process_return_code = daemon_process.wait()
+daemon_process_return_code = daemon_process.wait()
 
 daemon_process_output = daemon_process.communicate()[0]
 daemon_process_output = daemon_process_output.decode('utf-8').splitlines()
index fbe3c857a69c89c5ce22748b1ac91ba20e6145fe..77261539a439316acefc309792c11571e14a8581 100644 (file)
@@ -48,29 +48,13 @@ 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)
-
-if sys.version_info >= (3, 3):
-    try:
-        exit_fast_process.wait(5)
-    except subprocess.TimeoutExpired:
-        exit_fast_process.kill()
-        bail("Failed to run exit-fast test application.")
-else:
-    exit_fast_process.wait()
+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)
-
-if sys.version_info >= (3, 3):
-    try:
-        exit_fast_process.wait(5)
-    except subprocess.TimeoutExpired:
-        exit_fast_process.kill()
-        bail("Failed to run exit-fast test application in suicide mode.")
-else:
-    exit_fast_process.wait()
+exit_fast_process.wait()
 
 stop_session(session_info)
 
index ec444aef71143128c72d91550be1cd76a3739e02..3baa8cc389dc6aa88e4f21de8880b2ea324b19d2 100644 (file)
@@ -43,15 +43,7 @@ enable_ust_tracepoint_event(session_info, "ust_tests_fork*")
 start_session(session_info)
 
 fork_process = subprocess.Popen([test_path + "fork", test_path + "fork2"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-
-if sys.version_info >= (3, 3):
-    try:
-        fork_process.wait(5)
-    except subprocess.TimeoutExpired:
-        fork_process.kill()
-        bail("Failed to run fork test application (time out)", session_info)
-else:
-    fork_process.wait()
+fork_process.wait()
 
 parent_pid = -1
 child_pid = -1
index 8f3222cc31c601e447d8db62f4a79c90f70f3f77..545d5662f3030ef64d2e7880f984c6f855a55328 100644 (file)
@@ -43,14 +43,7 @@ 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)
-if sys.version_info >= (3, 3):
-    try:
-        malloc_process.wait(5)
-    except subprocess.TimeoutExpired:
-        malloc_process.kill()
-        bail("Failed to run libustinstr-malloc test application.", session_info)
-else:
-    malloc_process.wait()
+malloc_process.wait()
 
 print_test_result(malloc_process.returncode == 0, current_test, "Test application exited normally")
 current_test += 1
index f2081f8073d30b59f10f2eeebe1ddad8c2116f31..29128aa29d047266422dac520f4123393a5a519b 100644 (file)
@@ -111,14 +111,7 @@ if DYNAMIC_TEST_ENABLED:
 
     # Dry run, no events should be logged
     demo_process = subprocess.Popen(test_path + "demo", stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-    if sys.version_info >= (3 ,3):
-        try:
-            demo_process.wait(5)
-        except subprocess.TimeoutExpired:
-            demo_process.kill()
-            bail("Failed to run demo test application without preloading")
-    else:
-        demo_process.wait()
+    demo_process.wait()
     stop_session(session_info)
 
     print_test_result(demo_process.returncode == 0, current_test,\
@@ -137,14 +130,7 @@ for executable in test_executables:
     start_session(session_info)
 
     demo_process = subprocess.Popen(executable, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-    if sys.version_info >= (3, 3):
-        try:
-            demo_process.wait(5)
-        except subprocess.TimeoutExpired:
-            demo_process.kill()
-            bail("Failed to run {0} test application".format(executable_name))
-    else:
-        demo_process.wait()
+    demo_process.wait()
     stop_session(session_info)
 
     trace_found = os.path.exists(session_info.trace_path)
index 6f2d5ff689cbc20818eae24495ece89bb230e3e5..b2fa282a182b8efc2bbf24603ec7477e777c3075 100644 (file)
@@ -45,15 +45,7 @@ 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)
-
-if sys.version_info >= (3, 3):
-    try:
-        td_process.wait(5)
-    except TimeoutExpired:
-        td_process.kill()
-        bail("Failed to run type-declarations test application.")
-else:
-    td_process.wait()
+td_process.wait()
 
 print_test_result(td_process.returncode == 0, current_test, "Test application exited normally")
 current_test += 1
index 9801012a7e83791ec9f3a85f6da401f54c91098d..d9bc60a75bc27dd1a22c84ce7802ea3526f49b1c 100644 (file)
@@ -51,15 +51,7 @@ test_env["LD_LIBRARY_PATH"] = test_env.get("LD_LIBRARY_PATH", "") + ":" + test_p
 test_process = subprocess.Popen(test_path + "prog",
                                 stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                                 env=test_env)
-
-if sys.version_info >= (3, 3):
-    try:
-        test_process.wait(5)
-    except subprocess.TimeoutExpired:
-        test_process.kill()
-        bail("Failed to run ust-dl test application.", session_info)
-else:
-    test_process.wait()
+test_process.wait()
 
 print_test_result(test_process.returncode == 0, current_test, "Test application exited normally")
 current_test += 1
This page took 0.029628 seconds and 4 git commands to generate.