test_bugs.py 文件源码

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

项目:osbrain 作者: opensistemas-hub 项目源码 文件源码
def test_timer_recursion(nsproxy):
    """
    This bug occured with the first implementation of the timer. After
    some iterations the timer would throw an exception when the recursion
    limit was exceeded. Timers should never reach a recursion limit.
    """
    def inc(agent):
        agent.count += 1

    agent = run_agent('a0')
    agent.set_attr(count=0)
    agent.each(0.0, inc)

    limit = sys.getrecursionlimit()
    assert wait_agent_condition(agent, lambda agent: agent.count > limit,
                                timeout=10)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号