# HG changeset patch # User Gregory Szorc # Date 1397964438 25200 # Node ID e5eed8ded1685e526e634468befd0c31234aebbc # Parent 44c96e2bab2032e97801131dca2ff1bc8e484aa7 run-tests: handle interrupted in Test.run() diff -r 44c96e2bab20 -r e5eed8ded168 tests/run-tests.py --- a/tests/run-tests.py Sat Apr 19 20:22:32 2014 -0700 +++ b/tests/run-tests.py Sat Apr 19 20:27:18 2014 -0700 @@ -551,7 +551,8 @@ runs cannot be run concurrently. """ - def __init__(self, path, options, count, refpath): + def __init__(self, test, path, options, count, refpath): + self._test = test self._path = path self._options = options self._count = count @@ -598,7 +599,9 @@ result.out = out except KeyboardInterrupt: updateduration() - result.interrupted = True + log('INTERRUPTED: %s (after %d seconds)' % (self._test, + result.duration)) + raise except Exception, e: updateduration() result.exception = e @@ -673,7 +676,6 @@ self.ret = None self.out = None self.duration = None - self.interrupted = False self.exception = None self.refout = None @@ -1091,15 +1093,11 @@ if os.path.exists(err): os.remove(err) # Remove any previous output files - t = runner(testpath, options, count, ref) + t = runner(test, testpath, options, count, ref) res = TestResult() t.run(res) t.cleanup() - if res.interrupted: - log('INTERRUPTED: %s (after %d seconds)' % (test, res.duration)) - raise KeyboardInterrupt() - if res.exception: return fail('Exception during execution: %s' % res.exception, 255)