validate:launcher: Add an option for user to modify timeout values
authorThibault Saunier <thibault.saunier@osg.samsung.com>
Mon, 6 Feb 2017 15:16:41 +0000 (12:16 -0300)
committerThibault Saunier <thibault.saunier@osg.samsung.com>
Mon, 6 Feb 2017 15:16:41 +0000 (12:16 -0300)
Allowing to expand the test timeout when running on slow platforms

validate/launcher/baseclasses.py
validate/launcher/main.py

index 3f9e58ba318bd8072c64f6290dc6c0b39cec8d81..b9e5252a2208643bcbe866ba4b8093b1d060ed26 100644 (file)
@@ -70,11 +70,12 @@ class Test(Loggable):
         @hard_timeout: Max time the test can take in absolute
         """
         Loggable.__init__(self)
-        self.timeout = timeout * TIMEOUT_FACTOR
+        self.timeout = timeout * TIMEOUT_FACTOR * options.timeout_factor
         if hard_timeout:
             self.hard_timeout = hard_timeout * TIMEOUT_FACTOR
         else:
             self.hard_timeout = hard_timeout
+        self.hard_timeout *= options.timeout_factor
         self.classname = classname
         self.options = options
         self.application = application_name
index 9abb268a72a95beac69a62e17c7bf40d33275a16..e4eb68e7f9e828b85ce1eea71ae2506026a0220d 100644 (file)
@@ -305,7 +305,7 @@ class LauncherConfig(Loggable):
         if (self.main_dir != DEFAULT_MAIN_DIR or
                 self.clone_dir != QA_ASSETS):
             local_clone_dir = os.path.join(self.main_dir, self.clone_dir, "testsuites")
-            if not local_clone_dir in self.testsuites_dirs:
+            if local_clone_dir not in self.testsuites_dirs:
                 self.testsuites_dirs.insert(0, local_clone_dir)
         if self.valgrind:
             try:
@@ -386,6 +386,9 @@ Note that all testsuite should be inside python modules, so the directory should
     parser.add_argument("-d", "--debug", dest="debug",
                         action="store_true",
                         help="Let user debug the process on timeout")
+    parser.add_argument("--timeout-factor", dest="timeout_factor",
+                        default=1.0, type=float,
+                        help="Factor to be applied on all timeout values.")
     parser.add_argument("-f", "--forever", dest="forever",
                         action="store_true",
                         help="Keep running tests until one fails")