validate:tools: Clean test between runs when running forever
authorThibault Saunier <thibault.saunier@collabora.com>
Wed, 19 Feb 2014 12:07:03 +0000 (13:07 +0100)
committerThibault Saunier <thibault.saunier@collabora.com>
Wed, 19 Feb 2014 13:34:10 +0000 (14:34 +0100)
validate/tools/launcher/apps/gst-validate.py
validate/tools/launcher/baseclasses.py

index e0f866f..9d1c6c2 100644 (file)
@@ -155,7 +155,8 @@ class GstValidateLaunchTest(GstValidateTest):
         if self.scenario:
             sent_eos = self.sent_eos_position()
             if sent_eos is not None:
-                if ((time.time() - sent_eos)) > 30:
+                t = time.time()
+                if ((t - sent_eos)) > 30:
                     if self.file_infos.get("file-info", "protocol") == Protocols.HLS:
                         self.set_result(Result.PASSED,
                                         """Got no EOS 30 seconds after sending EOS,
@@ -241,7 +242,8 @@ class GstValidateTranscodingTest(GstValidateTest):
         if self.scenario:
             sent_eos = self.sent_eos_position()
             if sent_eos is not None:
-                if ((time.time() - sent_eos)) > 30:
+                t = time.time()
+                if ((t - sent_eos)) > 30:
                     if self.file_infos.get("file-info", "protocol") == Protocols.HLS:
                         self.set_result(Result.PASSED,
                                         """Got no EOS 30 seconds after sending EOS,
@@ -249,6 +251,7 @@ class GstValidateTranscodingTest(GstValidateTest):
                                         https://bugzilla.gnome.org/show_bug.cgi?id=723868""")
                         return Result.KNOWN_ERROR
 
+
                     return Result.FAILED
 
         return self.get_current_size()
index f6a78df..413bd8a 100644 (file)
@@ -54,6 +54,9 @@ class Test(Loggable):
         self.reporter = reporter
         self.process = None
 
+        self.clean()
+
+    def clean(self):
         self.message = ""
         self.error_str = ""
         self.time_taken = 0.0
@@ -224,6 +227,10 @@ class GstValidateTest(Test):
         else:
             self.scenario = scenario
 
+    def clean(self):
+        Test.clean(self)
+        self._sent_eos_pos = None
+
     def build_arguments(self):
         if self.scenario is not None:
             self.add_arguments("--set-scenario", self.scenario.name)
@@ -458,6 +465,10 @@ class TestsManager(Loggable):
 
         return Result.PASSED
 
+    def clean_tests(self):
+        for test in self.tests:
+            test.clean()
+
     def needs_http_server(self):
         return False
 
@@ -543,10 +554,14 @@ class _TestsLauncher(Loggable):
 
         return True
 
+    def _clean_tests(self):
+        for tester in self.testers:
+            tester.clean_tests()
+
     def run_tests(self):
         if self.options.forever:
             while self._run_tests():
-                continue
+                self._clean_tests()
 
             return False
         else: