changeset 21302:9e5d8eaa4a20

run-tests: move killdaemons into Test.run() killdaemons() was the only part of runone() looking at env variables. We move killdaemons() into Test.run() to enable us to fully move env into Test.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 19 Apr 2014 13:22:52 -0700
parents a77f4c2e1898
children 21a706020dd6
files tests/run-tests.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Sat Apr 19 13:18:55 2014 -0700
+++ b/tests/run-tests.py	Sat Apr 19 13:22:52 2014 -0700
@@ -560,7 +560,10 @@
     def run(self, env):
         createhgrc(env['HGRCPATH'], self._options)
 
-        return self._run(self._replacements, env)
+        try:
+            return self._run(self._replacements, env)
+        finally:
+            killdaemons(env['DAEMON_PIDS'])
 
     def _run(self, replacements, env):
         raise NotImplemented('Subclasses must implement Test.run()')
@@ -1036,8 +1039,6 @@
     times.append((test, endtime - starttime))
     vlog("# Ret was:", ret)
 
-    killdaemons(env['DAEMON_PIDS'])
-
     skipped = (ret == SKIPPED_STATUS)
 
     # If we're not in --debug mode and reference output file exists,