[meta]
    title = Test task retry - hold - release

[scheduling]
    [[graph]]
            R1 = """
t-retry-able:submit => t-hold-release
t-retry-able => t-analyse
"""

[runtime]
    [[t-retry-able]]
        # Note under bash 4.2 failed bare arithmetic tests such as
        # "(( VAR >= 3 ))" do not cause an abort under 'set -e'.
        script = test "${CYLC_TASK_TRY_NUMBER}" -ge 3
        [[[job]]]
            execution retry delays = PT15S, 2*PT1S
    [[t-hold-release]]
        script = """
cylc__job__poll_grep_suite_log -F \
    '[t-retry-able.1] -job(01) failed, retrying in PT15S'
cylc hold "${CYLC_SUITE_NAME}" 't-retry-able.1'
cylc__job__poll_grep_suite_log -F \
    '[t-retry-able.1] -retrying => retrying (held)'
cylc release "${CYLC_SUITE_NAME}" 't-retry-able.1'
cylc__job__poll_grep_suite_log -F \
    '[t-retry-able.1] -retrying (held) => retrying'
"""
    [[t-analyse]]
        script = """
test "$(readlink "$(dirname "$0")/../../t-retry-able/NN")" = '03'
"""
