#!jinja2
{%- set TEST_DIR = environ['TEST_DIR'] %}
[cylc]
    UTC mode = True
    [[events]]
        timeout handler = shutdown_this_suite_hook
        timeout = PT3M
[scheduling]
    initial cycle time = 20130923T00
    final cycle time   = 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
        """
        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
        """
