#!Jinja2

[scheduler]
    [[events]]
        abort on stall timeout = True
        stall timeout = PT0S
        abort on inactivity timeout = True
        inactivity timeout = PT3M

[scheduling]
    [[graph]]
        R1 = local-task:echo & remote-task:echo => cat-log

[runtime]
    [[ECHO]]
        script = """
            cylc__job__wait_cylc_message_started
            echo rubbish
            echo garbage >&2
            cylc message 'echo done'
        """
        [[[outputs]]]
            echo = "echo done"
    [[local-task]]
        inherit = ECHO
    [[remote-task]]
        platform = {{ environ['CYLC_TEST_PLATFORM'] }}
        inherit = ECHO
    [[cat-log]]
        script = """
            cylc__job__wait_cylc_message_started
            for TASK in '1/local-task' '1/remote-task'; do
                cylc cat-log --debug -f o \
                    "${CYLC_WORKFLOW_ID}//${TASK}" \
                    | grep 'rubbish'
                cylc cat-log --debug -f e \
                    "${CYLC_WORKFLOW_ID}//${TASK}" \
                    | grep 'garbage'
            done
        """
