#!jinja2
[cylc]
    [[events]]
        abort on stalled = True
        abort on inactivity = True
        inactivity = P1M
[scheduling]
    [[graph]]
        R1="t1 => t2 => t3"
[runtime]
    [[t1]]
        script = """
            cylc hold "${CYLC_SUITE_NAME}"
            cylc__job__poll_grep_suite_log -F \
                'INFO - Command succeeded: hold_suite()'
            cylc reset --state='succeeded' "${CYLC_SUITE_NAME}" 't2.1'
            cylc__job__poll_grep_suite_log \
                "INFO - Command succeeded: reset_task_states(\\['t2.1'\\],.*state=succeeded"
            cylc reset --state='waiting' "${CYLC_SUITE_NAME}" 't2.1'
            cylc__job__poll_grep_suite_log \
                "INFO - Command succeeded: reset_task_states(\\['t2.1'\\],.*state=waiting"
            cylc release "${CYLC_SUITE_NAME}"
        """
        [[[job]]]
            execution time limit = PT50S
        [[[events]]]
            failed handler = cylc release '%(suite)s'

    [[t2]]
        script = touch "${CYLC_SUITE_RUN_DIR}/t2.done"
    [[t3]]
        # This will fail if t3.1 starts together with t2.1
        script = test -e "${CYLC_SUITE_RUN_DIR}/t2.done"
