[meta]
    title = "test that a reloaded retrying task does retry"
    description = """this requires some state vars to be carried over to the
new task proxy; ref github #945"""
[scheduling]
    [[graph]]
        R1 = retrier & reloader
[runtime]
    [[retrier]]
        script = """
wait
sleep 1
if ((CYLC_TASK_TRY_NUMBER == 1)); then
    # Kill the job, so task will go into retrying (held)
    cylc kill "${CYLC_SUITE_NAME}" 'retrier.1'
    sleep 120  # Does not matter how long as the job will be killed
fi
"""
        [[[job]]]
            execution retry delays = PT0S
    [[reloader]]
        script = """
cylc__job__poll_grep_suite_log -F '[retrier.1] -running (held) => retrying (held)'
cylc reload "${CYLC_SUITE_NAME}"
cylc reload -f "${CYLC_SUITE_NAME}"
cylc__job__poll_grep_suite_log -F 'Reload completed'
cylc release "${CYLC_SUITE_NAME}" 'retrier.1'
"""
