[Lldb-commits] [PATCH] dosep.py: Add ability to set default test timout based on target

Pavel Labath labath at google.com
Wed Jun 17 18:25:36 PDT 2015


Hi sivachandra, vharron,

Current default is 10 minutes, which causes the test suite to run very long in
case of test timeouts. On linux, each test completes in under 90 seconds in the
slowest configuration (debug build of lldb, using debug clang to build
inferiors). So a default timeout of 4 minutes should suffice. If it turns out
to be not enough, we can fiddle with the number a bit.

http://reviews.llvm.org/D10527

Files:
  test/dosep.py

Index: test/dosep.py
===================================================================
--- test/dosep.py
+++ test/dosep.py
@@ -61,8 +61,6 @@
 
 timeout_command = get_timeout_command()
 
-default_timeout = os.getenv("LLDB_TEST_TIMEOUT") or "10m"
-
 # Status codes for running command with timeout.
 eTimedOut, ePassed, eFailed = 124, 0, 1
 
@@ -271,6 +269,22 @@
         }
     return expected_timeout
 
+def getDefaultTimeout(platform_name):
+    if os.getenv("LLDB_TEST_TIMEOUT"):
+        return os.getenv("LLDB_TEST_TIMEOUT")
+
+    if platform_name is None:
+        target = sys.platform
+    else:
+        m = re.search('remote-(\w+)', platform_name)
+        target = m.group(1)
+
+    if target.startswith("android"):
+        return "10m"
+    else:
+        return "4m"
+
+
 def touch(fname, times=None):
     with open(fname, 'a'):
         os.utime(fname, times)
@@ -360,6 +374,9 @@
     if num_threads < 1:
         num_threads = 1
 
+    global default_timeout
+    default_timeout = getDefaultTimeout(dotest_options.lldb_platform_name)
+
     system_info = " ".join(platform.uname())
     (timed_out, failed, passed, all_fails, all_passes) = walk_and_invoke(test_directory, test_subdir, dotest_argv, num_threads)

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10527.27907.patch
Type: text/x-patch
Size: 1233 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150618/ad47cdd3/attachment.bin>


More information about the lldb-commits mailing list