[meta]
    title = Test reload waiting task integrity error

[scheduling]
    [[graph]]
# SoD: starter:start added to create a partially satisfied waiting task
# to be present during the reload.
        R1 = """
starter:start => waiter
sleeping-waiter => waiter
sleeping-waiter:start => reloader
"""

[runtime]
    [[sleeping-waiter, starter]]
        script = """
touch 'file'
while [[ -e 'file' ]]; do
    sleep 1
done
"""
    [[waiter]]
        script = true
    [[reloader]]
        script = """
cylc__job__wait_cylc_message_started
cylc reload "${CYLC_WORKFLOW_ID}"
cylc__job__poll_grep_workflow_log -E '1/waiter.* reloaded task definition'
rm -f "${CYLC_WORKFLOW_WORK_DIR}/1/sleeping-waiter/file"
rm -f "${CYLC_WORKFLOW_WORK_DIR}/1/starter/file"
        """
