#!Jinja2

[scheduler]
    [[events]]
        expected task failures = 1/foo

[scheduling]
    [[graph]]
        R1 = """
            foo:submit? => kill_foo_submit => poll_foo
            foo:submit-fail? => stop
        """

[runtime]
    [[foo]]
        platform = {{ environ['CYLC_TEST_PLATFORM'] }}
    [[poll_foo]]
        script = """
           cylc__job__wait_cylc_message_started
           cylc poll "$CYLC_WORKFLOW_ID//*/foo"
        """
    [[stop]]
        script = cylc stop $CYLC_WORKFLOW_ID
    [[kill_foo_submit]]
        script = """
            cylc__job__wait_cylc_message_started
            ID=$(sed -n "s/^CYLC_JOB_ID=//p" \
                 $CYLC_WORKFLOW_RUN_DIR/log/job/1/foo/01/job.status)
            atrm $ID
        """
