test_rolld.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:rolld 作者: Hipo 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号