Patchwork [030,of,179,tests-refactor] run-tests: generate timeout result in Test.run()

login
register
mail settings
Submitter Gregory Szorc
Date May 2, 2014, 6:37 p.m.
Message ID <0f3a03707e6879ff0b21.1399055867@vm-ubuntu-main.gateway.sonic.net>
Download mbox | patch
Permalink /patch/4524/
State Accepted
Commit 0e66eb57e42a76d877b8e1abe9d0417d80992c62
Headers show

Comments

Gregory Szorc - May 2, 2014, 6:37 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1397965696 25200
#      Sat Apr 19 20:48:16 2014 -0700
# Branch stable
# Node ID 0f3a03707e6879ff0b2149724966f8806426c446
# Parent  2abe63ab6518ea458bbf25c959992f77d677c4bd
run-tests: generate timeout result in Test.run()

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -628,16 +628,18 @@  class Test(object):
                 missing = ['irrelevant']
 
             if failed:
                 return self.fail('hg have failed checking for %s' % failed[-1],
                                  ret)
             else:
                 result.skipped = True
                 return self.skip(missing[-1])
+        elif ret == 'timeout':
+            return self.fail('timed out', ret)
 
     def _run(self, testtmp, replacements, env):
         raise NotImplemented('Subclasses must implement Test.run()')
 
     def _getreplacements(self, testtmp):
         port = self._options.port + self._count * 3
         r = [
             (r':%s\b' % port, ':$HGPORT'),
@@ -1136,18 +1138,16 @@  def runone(options, test, count):
         # Save errors to a file for diagnosis
         f = open(err, "wb")
         for line in out:
             f.write(line)
         f.close()
 
     if result:
         pass
-    elif ret == 'timeout':
-        result = t.fail("timed out", ret)
     elif out != refout:
         info = {}
         if not options.nodiff:
             iolock.acquire()
             if options.view:
                 os.system("%s %s %s" % (options.view, ref, err))
             else:
                 info = showdiff(refout, out, ref, err)