#!jinja2
{%- set TEST_DIR = environ['TEST_DIR'] %}
[cylc]
    [[events]]
        timeout handler = "touch {{ TEST_DIR }}/suite-stopping && shutdown_this_suite_hook"
        timeout = 1
[scheduling]
    initial cycle time = 2010080800
    final cycle time = 2010080806
    [[dependencies]]
        graph = "p1 => p2"
        [[[0]]]
            graph = """p2 => foo
                foo[T-24] => foo => bar"""
[runtime]
    [[p1]]
        script = """
wait "${CYLC_TASK_MESSAGE_STARTED_PID}"
sleep 1
cylc shutdown --now --max-polls=30 --interval=2 $CYLC_SUITE_NAME
cylc restart $CYLC_SUITE_NAME
"""
    [[foo, p2]]
        script = true
    [[bar]]
        script = touch {{ TEST_DIR }}/suite-stopping
