#!jinja2
{%- set TEST_DIR = environ['TEST_DIR'] %}
[scheduler]
    UTC mode = True
    [[events]]
        abort on stall timeout = True
        stall timeout = PT1M
[scheduling]
    initial cycle point = 20130923T00
    final cycle point   = 20130923T00
    [[graph]]
        R1 = """
            send_a_broadcast_task => shutdown
            shutdown => output_states
            output_states => broadcast_task
            broadcast_task => finish
        """
[runtime]
    [[send_a_broadcast_task]]
        script = """
            cylc broadcast -n broadcast_task -p $CYLC_TASK_CYCLE_POINT -s "[environment]MY_VALUE='something'" $CYLC_WORKFLOW_ID
            cylc broadcast -d $CYLC_WORKFLOW_ID
        """
        [[[meta]]]
            description = "Broadcast setup task"
    [[broadcast_task]]
        script = """
            if [[ "$MY_VALUE" != "something" ]]; then
                echo "[FAIL] MY_VALUE ($MY_VALUE) not set correctly by broadcast" >&2
                exit 1
            fi
            echo "[PASS] MY_VALUE=$MY_VALUE"
        """
        [[[meta]]]
            description = "Broadcast-recipient task (runs after restart)"
        [[[environment]]]
            MY_VALUE=nothing
{% include 'flow-runtime-restart.cylc' %}
