#!Jinja2
[scheduling]
    [[graph]]
        R1 = a-task:echo => b-task
[runtime]
    [[a-task]]
        script = """
echo rubbish
echo garbage >&2
cylc message 'echo done'
sleep 60
"""
        [[[remote]]]
            host={{environ["CYLC_TEST_HOST"]}}
        [[[job]]]
            batch system=pbs
        [[[directives]]]
{% if "CYLC_TEST_DIRECTIVES" in environ and environ["CYLC_TEST_DIRECTIVES"] %}
            {{environ["CYLC_TEST_DIRECTIVES"]}}
{% endif %}
        [[[outputs]]]
            echo = "echo done"

    [[b-task]]
        script = """
sleep 10  # wait for buffer to flush?
cylc cat-log --debug -f o "${CYLC_SUITE_NAME}" 'a-task.1' | grep 'rubbish'
cylc cat-log --debug -f e "${CYLC_SUITE_NAME}" 'a-task.1' | grep 'garbage'
"""
