harness: mt_waitset test: increase test timeout by factor 2, properly implement proce...
authorSimon Gerber <simon.gerber@inf.ethz.ch>
Mon, 10 Oct 2016 08:32:49 +0000 (10:32 +0200)
committerSimon Gerber <simon.gerber@inf.ethz.ch>
Mon, 10 Oct 2016 08:34:51 +0000 (10:34 +0200)
Signed-off-by: Simon Gerber <simon.gerber@inf.ethz.ch>

tools/harness/tests/mt_waitset.py

index cc676c7..dde9d4f 100644 (file)
@@ -11,13 +11,19 @@ import re
 import tests
 from common import TestCommon
 from results import PassFailResult
-import logging, sys
+import debug
 
 @tests.add_test
 class MultithreadedWaitsetTest(TestCommon):
     '''multithreaded waitset functionality'''
     name = "mt_waitset"
 
+    def setup(self, build, machine, testdir):
+        super(MultithreadedWaitsetTest, self).setup(build, machine, testdir)
+        self.test_timeout_delta *= 2
+        debug.verbose("%s: increasing test timeout delta by factor 2: new = %s" %
+                (self.name, self.test_timeout_delta))
+
     def get_modules(self, build, machine):
         modules = super(MultithreadedWaitsetTest, self).get_modules(build, machine)
         modules.add_module("mt_waitset", ["10", "10", "100000", "8"])
@@ -27,7 +33,8 @@ class MultithreadedWaitsetTest(TestCommon):
         return "Test PASSED" in line or "Test FAILED" in line
 
     def process_data(self, testdir, rawiter):
+        passed = False
         for line in rawiter:
             if "Test PASSED" in line:
-                PassFailResult(True)
-        PassFailResult(False)
+                passed = True
+        return PassFailResult(passed)