def exit_test():
global periodic_checker
if periodic_checker:
periodic_checker.stop()
os.kill(rolld_proc.pid, signal.SIGTERM)
os.kill(nginx_proc.pid, signal.SIGTERM)
# IOLoop.instance().add_timeout(time.time() + 5, partial(sys.exit, 0))
# check if we have zombies left
try:
lines = subprocess.check_output('ps auxw | grep python | grep app.py | grep -v grep', shell=True)
print lines
assert len(lines) == 0
except subprocess.CalledProcessError as grepexc:
# grep shouldnt find anything so exit code should be 1
if grepexc.returncode == 1:
pass
else:
raise
# if everything is fine, just stop our ioloop now.
IOLoop.current().stop()
评论列表
文章目录