#!Jinja2
[cylc]
   [[events]]
       abort on stalled = True
   [[reference test]]
       live mode suite timeout = PT1M
       required run mode = live
[scheduling]
    cycling mode = integer
    initial cycle point = 1
    final cycle point = 5
    [[dependencies]]
        [[[R1]]]
            graph="set-stop-point => reload => t1"
        [[[P1]]]
            graph="t1[-P1] => t1"

[runtime]
    [[set-stop-point]]
        script=cylc stop "${CYLC_SUITE_NAME}" '3'
    [[reload]]
        script="""
wait "${CYLC_TASK_MESSAGE_STARTED_PID}" 2>/dev/null || true
cylc reload "${CYLC_SUITE_NAME}"
LOG="${CYLC_SUITE_LOG_DIR}/log"
while ! grep -q 'Reload completed' "${LOG}"; do
    sleep 1  # make sure reload completes
done
"""
        [[[job]]]
            execution time limit = PT1M
    [[t1]]
        script=true
