Bug 1398933 - Follow-up, fix cannot compare timedelta bustage, on a CLOSED TREE
authorGeoff Brown <gbrown@mozilla.com>
Tue, 12 Sep 2017 09:35:13 -0600
changeset 663355 f559248aac81105d5e83105f5ff75934709ca6b8
parent 663354 fd7e4852bd06df199e89663b6d4e7ca5c3f2e0ea
child 663356 be5bcc9e9657f8ccfc304cda349899ec19caee6f
push id79424
push userbmo:tchiovoloni@mozilla.com
push dateTue, 12 Sep 2017 23:17:54 +0000
bugs1398933
milestone57.0a1
Bug 1398933 - Follow-up, fix cannot compare timedelta bustage, on a CLOSED TREE
testing/mozharness/scripts/desktop_unittest.py
--- a/testing/mozharness/scripts/desktop_unittest.py
+++ b/testing/mozharness/scripts/desktop_unittest.py
@@ -665,16 +665,17 @@ class DesktopUnittest(TestingMixin, Merc
     def _run_category_suites(self, suite_category):
         """run suite(s) to a specific category"""
         dirs = self.query_abs_dirs()
         suites = self._query_specified_suites(suite_category)
         abs_app_dir = self.query_abs_app_dir()
         abs_res_dir = self.query_abs_res_dir()
 
         max_verify_time = timedelta(minutes=60)
+        verify_time_exceeded = False
         start_time = datetime.now()
 
         if suites:
             self.info('#### Running %s suites' % suite_category)
             for suite in suites:
                 abs_base_cmd = self._query_abs_base_cmd(suite_category, suite)
                 cmd = abs_base_cmd[:]
                 replace_dict = {
@@ -757,17 +758,17 @@ class DesktopUnittest(TestingMixin, Merc
 
                 for verify_args in self.query_verify_args(suite):
                     if (datetime.now() - start_time) > max_verify_time:
                         # Verification has run out of time. That is okay! Stop running
                         # tests so that a task timeout is not triggered, and so that
                         # (partial) results are made available in a timely manner.
                         self.info("TinderboxPrint: Verification too long: Not all tests were verified.<br/>")
                         # Signal verify time exceeded, to break out of suites loop also.
-                        max_verify_time = 0
+                        verify_time_exceeded = True
                         break
                     final_cmd = copy.copy(cmd)
                     final_cmd.extend(verify_args)
                     return_code = self.run_command(final_cmd, cwd=dirs['abs_work_dir'],
                                                    output_timeout=cmd_timeout,
                                                    output_parser=parser,
                                                    env=env)
 
@@ -793,17 +794,17 @@ class DesktopUnittest(TestingMixin, Merc
                     self.buildbot_status(tbpl_status, level=log_level)
                     if len(verify_args) > 0:
                         self.log("TinderboxPrint: verification of %s in %s<br/>: %s" %
                                  (verify_args[-1], suite, tbpl_status), level=log_level)
                     else:
                         self.log("The %s suite: %s ran with return status: %s" %
                                  (suite_category, suite, tbpl_status), level=log_level)
 
-                if max_verify_time <= 0:
+                if verify_time_exceeded:
                     # Verification ran out of time, detected in inner loop.
                     break
         else:
             self.debug('There were no suites to run for %s' % suite_category)
 
 
 # main {{{1
 if __name__ == '__main__':