# HG changeset patch # User Gregory Szorc # Date 1397964152 25200 # Node ID 44c96e2bab2032e97801131dca2ff1bc8e484aa7 # Parent 6b3d66e4d3bed7d3bf5c7b96eec9d218f193729a run-tests: kill daemons during Test.cleanup() As a safety precaution, we kill daemons in Test.cleanup(). This is necessary for a subsequent patch that will reraise KeyboardInterrupt before killdaemons() runs as part of run(). diff -r 6b3d66e4d3be -r 44c96e2bab20 tests/run-tests.py --- a/tests/run-tests.py Sat Apr 19 18:50:40 2014 -0700 +++ b/tests/run-tests.py Sat Apr 19 20:22:32 2014 -0700 @@ -555,6 +555,7 @@ self._path = path self._options = options self._count = count + self._daemonpids = [] # If we're not in --debug mode and reference output file exists, # check test output against it. @@ -571,6 +572,9 @@ os.mkdir(self._threadtmp) def cleanup(self): + for entry in self._daemonpids: + killdaemons(entry) + if self._threadtmp and not self._options.keep_tmpdir: shutil.rmtree(self._threadtmp, True) @@ -579,6 +583,7 @@ os.mkdir(testtmp) replacements, port = self._getreplacements(testtmp) env = self._getenv(testtmp, port) + self._daemonpids.append(env['DAEMON_PIDS']) createhgrc(env['HGRCPATH'], self._options) starttime = time.time()