autotest: try harder to kill child processes

This commit is contained in:
Andrew Tridgell 2011-11-09 17:44:14 +11:00
parent e32171b185
commit 016e84ee21

View File

@ -73,7 +73,10 @@ def pexpect_autoclose(p):
def pexpect_close(p): def pexpect_close(p):
'''close a pexpect child''' '''close a pexpect child'''
global close_list global close_list
p.close()
time.sleep(1)
p.close(force=True) p.close(force=True)
if p in close_list:
close_list.remove(p) close_list.remove(p)
def pexpect_close_all(): def pexpect_close_all():
@ -81,11 +84,13 @@ def pexpect_close_all():
global close_list global close_list
for p in close_list[:]: for p in close_list[:]:
try: try:
p.close()
time.sleep(1)
p.close(Force=True) p.close(Force=True)
except Exception: except Exception:
pass pass
def start_SIL(atype, valgrind=True, wipe=False, CLI=False): def start_SIL(atype, valgrind=False, wipe=False, CLI=False):
'''launch a SIL instance''' '''launch a SIL instance'''
cmd="" cmd=""
if valgrind and os.path.exists('/usr/bin/valgrind'): if valgrind and os.path.exists('/usr/bin/valgrind'):