From 1f9c67e6ff1077b8cb42085f5a32d72246d8e889 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Thu, 22 Dec 2016 10:08:27 -0300 Subject: [PATCH] validate:launcher: Allow specifying a timeout factor --- validate/launcher/baseclasses.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/validate/launcher/baseclasses.py b/validate/launcher/baseclasses.py index eb9b58caee..a46c8b706d 100644 --- a/validate/launcher/baseclasses.py +++ b/validate/launcher/baseclasses.py @@ -46,6 +46,7 @@ from .utils import mkdir, Result, Colors, printc, DEFAULT_TIMEOUT, GST_SECOND, \ # The factor by which we increase the hard timeout when running inside # Valgrind GDB_TIMEOUT_FACTOR = VALGRIND_TIMEOUT_FACTOR = 20 +TIMEOUT_FACTOR = float(os.environ.get("TIMEOUT_FACTOR", 1)) # The error reported by valgrind when detecting errors VALGRIND_ERROR_CODE = 20 @@ -70,8 +71,11 @@ class Test(Loggable): @hard_timeout: Max time the test can take in absolute """ Loggable.__init__(self) - self.timeout = timeout - self.hard_timeout = hard_timeout + self.timeout = timeout * TIMEOUT_FACTOR + if hard_timeout: + self.hard_timeout = hard_timeout * TIMEOUT_FACTOR + else: + self.hard_timeout = hard_timeout self.classname = classname self.options = options self.application = application_name