| 1 |
#!/usr/bin/env bash |
| 2 |
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE. |
| 3 |
# Copyright (C) NIWA & British Crown (Met Office) & Contributors. |
| 4 |
# |
| 5 |
# This program is free software: you can redistribute it and/or modify |
| 6 |
# it under the terms of the GNU General Public License as published by |
| 7 |
# the Free Software Foundation, either version 3 of the License, or |
| 8 |
# (at your option) any later version. |
| 9 |
# |
| 10 |
# This program is distributed in the hope that it will be useful, |
| 11 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
# GNU General Public License for more details. |
| 14 |
# |
| 15 |
# You should have received a copy of the GNU General Public License |
| 16 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
#------------------------------------------------------------------------------- |
| 18 |
# Test that spawned children of released tasks are held when the workflow has |
| 19 |
# a hold point. |
| 20 |
. "$(dirname "$0")/test_header" |
| 21 |
set_test_number 2 |
| 22 |
init_workflow "${TEST_NAME_BASE}" <<'__FLOW_CONFIG__' |
| 23 |
[scheduling] |
| 24 |
[[dependencies]] |
| 25 |
R1 = "foo => bar" |
| 26 |
[runtime] |
| 27 |
[[foo, bar]] |
| 28 |
script = cylc__job__wait_cylc_message_started; true |
| 29 |
__FLOW_CONFIG__ |
| 30 |
|
| 31 |
workflow_run_ok "${TEST_NAME_BASE}-run" \ |
| 32 |
cylc play --hold-after=0 --debug "${WORKFLOW_NAME}" |
| 33 |
|
| 34 |
cylc release "${WORKFLOW_NAME}//1/foo" |
| 35 |
# 1/foo should run and spawn 1/bar as waiting and held |
| 36 |
|
| 37 |
poll_grep_workflow_log -E '1/bar.* added to the n=0 window' |
| 38 |
|
| 39 |
sqlite3 "${WORKFLOW_RUN_DIR}/log/db" \ |
| 40 |
'SELECT cycle, name, status, is_held FROM task_pool' > task-pool.out |
| 41 |
|
| 42 |
cmp_ok task-pool.out <<__OUT__ |
| 43 |
1|bar|waiting|1 |
| 44 |
__OUT__ |
| 45 |
|
| 46 |
cylc stop --now --now "${WORKFLOW_NAME}" |
| 47 |
|
| 48 |
purge |