Comments
Patch
@@ -548,40 +548,45 @@ class Test(object):
Test instances can be run multiple times via run(). However, multiple
runs cannot be run concurrently.
"""
def __init__(self, path, options, count, refpath):
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.
if options.debug:
self._refout = None # to match "out is None"
elif os.path.exists(refpath):
f = open(refpath, 'r')
self._refout = f.read().splitlines(True)
f.close()
else:
self._refout = []
self._threadtmp = os.path.join(HGTMP, 'child%d' % count)
os.mkdir(self._threadtmp)
def __del__(self):
+ for entry in self._daemonpids:
+ killdaemons(entry)
+
if self._threadtmp and not self._options.keep_tmpdir:
shutil.rmtree(self._threadtmp, True)
def run(self, result):
testtmp = os.path.join(self._threadtmp, os.path.basename(self._path))
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()
def updateduration():
result.duration = time.time() - starttime
try: