From 41b3f630d72f8c7b41e249235c2ca979e3eee0ba Mon Sep 17 00:00:00 2001 From: Vince Harron Date: Fri, 5 Dec 2014 02:06:03 +0000 Subject: [PATCH] Reverting r223423, test timeout Was causing dosep to hang in some cases. llvm-svn: 223441 --- lldb/test/dosep.py | 42 +++++++++--------------------------------- 1 file changed, 9 insertions(+), 33 deletions(-) diff --git a/lldb/test/dosep.py b/lldb/test/dosep.py index eb4ff94..153b8fc 100755 --- a/lldb/test/dosep.py +++ b/lldb/test/dosep.py @@ -7,29 +7,15 @@ Run the test suite using a separate process for each test file. import multiprocessing import os import platform -import shlex -import subprocess import sys from optparse import OptionParser -def try_timeout(command): - if not sys.platform.startswith("win32"): - try: - return {0: "passed", 124: "timed out"}.get( - subprocess.call(["timeout", "5m"] + command), "failed") - except OSError: - pass - try: - return {0: "passed", 124: "timed out"}.get( - subprocess.call(["gtimeout", "5m"] + command), "failed") - except OSError: - pass - return "passed" if subprocess.call(command) == 0 else "failed" +# Command template of the invocation of the test driver. +template = '%s %s/dotest.py %s -p %s %s' def process_dir(root, files, test_root, dotest_options): """Examine a directory for tests, and invoke any found within it.""" - timed_out = [] failed = [] passed = [] for name in files: @@ -43,17 +29,12 @@ def process_dir(root, files, test_root, dotest_options): if os.path.islink(path): continue - command = ([sys.executable, "%s/dotest.py" % test_root] + - (shlex.split(dotest_options) if dotest_options else []) + - ["-p", name, root]) - exit_status = try_timeout(command) - if "passed" != exit_status: - if "timed out" == exit_status: - timed_out.append(name) + command = template % (sys.executable, test_root, dotest_options if dotest_options else "", name, root) + if 0 != os.system(command): failed.append(name) else: passed.append(name) - return (timed_out, failed, passed) + return (failed, passed) in_q = None out_q = None @@ -85,17 +66,15 @@ def walk_and_invoke(test_root, dotest_options, num_threads): for work_item in test_work_items: test_results.append(process_dir_worker(work_item)) - timed_out = [] failed = [] passed = [] for test_result in test_results: - (dir_timed_out, dir_failed, dir_passed) = test_result - timed_out += dir_timed_out + (dir_failed, dir_passed) = test_result failed += dir_failed passed += dir_passed - return (timed_out, failed, passed) + return (failed, passed) def main(): test_root = sys.path[0] @@ -128,8 +107,7 @@ Run lldb test suite using a separate process for each test file. num_threads = 1 system_info = " ".join(platform.uname()) - (timed_out, failed, passed) = walk_and_invoke(test_root, dotest_options, - num_threads) + (failed, passed) = walk_and_invoke(test_root, dotest_options, num_threads) num_tests = len(failed) + len(passed) print "Ran %d tests." % num_tests @@ -137,9 +115,7 @@ Run lldb test suite using a separate process for each test file. failed.sort() print "Failing Tests (%d)" % len(failed) for f in failed: - print "%s: LLDB (suite) :: %s (%s)" % ( - "TIMEOUT" if f in timed_out else "FAIL", f, system_info - ) + print "FAIL: LLDB (suite) :: %s (%s)" % (f, system_info) sys.exit(1) sys.exit(0) -- 2.7.4