def test_without_timeout(tmpdir, execution, session):
    """Test the task.timeout is respected overt scheduler.timeout"""
    with tmpdir.as_cwd():

        func_run_slow = get_slow_func(execution)
        task = FuncTask(func_run_slow, name="slow task but passing", start_cond=AlwaysTrue(), timeout="never", execution=execution, session=session)

        session.config.shut_cond = (TaskFinished(task="slow task but passing") >= 2) | ~SchedulerStarted(period=TimeDelta("20 seconds"))
        session.config.timeout = 0.1
        session.start()

        logger = task.logger
        # If Scheduler is quick, it may launch the task 3 times
        # but there still should not be any terminations
        assert 2 <= logger.filter_by(action="run").count()
        assert 0 == logger.filter_by(action="terminate").count()
        assert 2 <= logger.filter_by(action="success").count()
        assert 0 == logger.filter_by(action="fail").count()

        assert os.path.exists("work.txt")
Test the task.timeout is respected overt scheduler.timeout
rocketry/test/schedule/test_terminate.py