Debian Codegraph @

tests/functional/restart/33-simulation.t

raw
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 https://github.com/cylc/cylc-flow/issues/2788
19 . "$(dirname "$0")/test_header"
20
21 set_test_number 5
22 init_workflow "${TEST_NAME_BASE}" <<'__FLOW_CONFIG__'
23 [scheduler]
24 cycle point format = %Y
25 [[events]]
26 abort on stall timeout = True
27 stall timeout = PT0S
28 [scheduling]
29 initial cycle point = 2018
30 [[graph]]
31 P1Y = t1
32 [runtime]
33 [[t1]]
34 script = true
35 __FLOW_CONFIG__
36
37 run_ok "${TEST_NAME_BASE}-validate" cylc validate "${WORKFLOW_NAME}"
38 workflow_run_ok "${TEST_NAME_BASE}-run" \
39 cylc play --no-detach --stopcp=2019 --mode=simulation --abort-if-any-task-fails "${WORKFLOW_NAME}"
40 # Force a waiting task into a running task
41 run_ok "${TEST_NAME_BASE}-sql1" sqlite3 "${HOME}/cylc-run/${WORKFLOW_NAME}/.service/db" \
42 "UPDATE task_states SET status='running' WHERE name=='t1' AND cycle=='2019'"
43 run_ok "${TEST_NAME_BASE}-sql1" sqlite3 "${HOME}/cylc-run/${WORKFLOW_NAME}/.service/db" \
44 "UPDATE task_pool SET status='running' WHERE name=='t1' AND cycle=='2019'"
45 workflow_run_ok "${TEST_NAME_BASE}-restart" \
46 cylc play --debug --no-detach --fcp=2020 --mode=simulation --abort-if-any-task-fails "${WORKFLOW_NAME}"
47 purge
48 exit