#!Jinja2
[scheduler]
    UTC mode = True
    [[events]]
        expected task failures = 1/local-fail-1, 1/local-fail-2, 1/remote-fail-1
[scheduling]
    [[graph]]
        R1 = """
            POLLABLE:start-all => poller
            POLLABLE:succeed-any  # (make member success optional)
        """
[runtime]
    [[POLLABLE]]
        init-script = cylc__job__disable_fail_signals ERR EXIT
    [[FAIL]]
        inherit = POLLABLE
        script = """
            echo 'I am failing...' >&2
            exit 1
        """
    [[local-fail-1, local-fail-2]]
        inherit = FAIL
    [[remote-fail-1]]
        inherit = FAIL
        platform = {{ environ['CYLC_TEST_PLATFORM'] }}
    [[SUCCESS]]
        inherit = POLLABLE
        script = """
            echo 'I am OK.'
            {
                echo 'CYLC_JOB_EXIT=SUCCEEDED'
                echo "CYLC_JOB_EXIT_TIME=$(date +%FT%H:%M:%SZ)"
            } >>"${CYLC_TASK_LOG_ROOT}.status"
            exit 1
        """
    [[local-success-1]]
        inherit = SUCCESS
    [[remote-success-1, remote-success-2]]
        inherit = SUCCESS
        platform = {{ environ['CYLC_TEST_PLATFORM'] }}
    [[poller]]
        script = """
            cylc poll "${CYLC_WORKFLOW_ID}//*/POLLABLE"
            cylc stop "${CYLC_WORKFLOW_ID}"
        """
