run-tests: move killdaemons into Test.run()
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 19 Apr 2014 13:22:52 -0700
changeset 21302 9e5d8eaa4a20
parent 21301 a77f4c2e1898
child 21303 21a706020dd6
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.
tests/run-tests.py
--- 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,