#!jinja2
{%- set TEST_DIR = environ['TEST_DIR'] %}
[cylc]
    UTC mode = True
    [[events]]
        abort on timeout = True
        timeout = PT3M
[scheduling]
    initial cycle point = 20130923T00
    final cycle point   = 20130926T00
    [[graph]]
        PT12H = """
            foo[-PT12H] => foo => bar
            bar[-P1D] => bar
        """
        R1/20130925T0000Z = """
            bar[-P1D] & bar[-PT12H] & foo[-PT12H] => shutdown => output_states
            output_states => foo => bar
        """
[runtime]
    [[foo,bar]]
        script = """
            sleep 1
        """
        [[[meta]]]
            description = "Placeholder tasks for dependencies"
    [[OUTPUT]]
        script = """
            sleep 5
            ctb-select-task-states \
                "${CYLC_SUITE_RUN_DIR}" "${CYLC_TASK_NAME}" \
                > {{ TEST_DIR }}/$OUTPUT_SUFFIX-db
        """
    [[shutdown]]
        inherit = OUTPUT
        post-script = """
            cylc shutdown $CYLC_SUITE_NAME
            sleep 5
        """
        [[[meta]]]
            description = "Force a shutdown of the suite"
        [[[environment]]]
            OUTPUT_SUFFIX=pre-restart
    [[output_states]]
        inherit = OUTPUT
        pre-script = """
            sleep 5
        """
        [[[meta]]]
            description = "Wait for the restart to complete, then output states"
        [[[environment]]]
            OUTPUT_SUFFIX=post-restart
