#!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   = 20130923T00
    [[dependencies]]
        [[[R1]]]
            graph = """
                retrying_task:start => shutdown
                shutdown => output_states
                output_states & retrying_task => finish
            """
[runtime]
    [[retrying_task]]
        script = """
            sleep 10
            if [[ $CYLC_TASK_TRY_NUMBER -le 2 ]]; then
                exit 1
            fi
        """
        [[[meta]]]
            description = "Retrying state task for restart"
        [[[job]]]
            execution retry delays = PT40S, PT1S
{% include 'suite-runtime-restart.rc' %}
    [[shutdown]]
        pre-script = sleep 5  # Extra sleep as trigger from retry task start.
    [[output_states]]
        pre-script = """
            sleep 10
        """
