Debian Codegraph @

tests/f/restart/55-stalled.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
19 # Test restarting a stalled workflow: stall timer should reset.
20
21 . "$(dirname "$0")/test_header"
22
23 grep_for_stall() {
24 SUFFIX=$1
25 grep_workflow_log_ok "grep-${SUFFIX}-1" 'Workflow stalled'
26 grep_workflow_log_ok "grep-${SUFFIX}-2" 'PT2S stall timer starts NOW'
27 grep_workflow_log_ok "grep-${SUFFIX}-3" 'stall timer timed out after PT2S'
28 grep_workflow_log_ok "grep-${SUFFIX}-4" 'Workflow shutting down - "abort on stall timeout" is set'
29 }
30
31 set_test_number 12
32
33 init_workflow "${TEST_NAME_BASE}" <<'__FLOW_CONFIG__'
34 [scheduler]
35 [[events]]
36 stall timeout = PT2S
37 abort on stall timeout = True
38 [scheduling]
39 [[graph]]
40 R1 = foo
41 [runtime]
42 [[foo]]
43 script = false
44 __FLOW_CONFIG__
45
46 run_ok "${TEST_NAME_BASE}-validate" cylc validate "${WORKFLOW_NAME}"
47
48 workflow_run_fail "${TEST_NAME_BASE}-run" cylc play "${WORKFLOW_NAME}" --no-detach
49 grep_for_stall run
50
51 # Rinse and repeat
52 workflow_run_fail "${TEST_NAME_BASE}-run" cylc play "${WORKFLOW_NAME}" --no-detach
53 grep_workflow_log_ok grep-restart 'Run: \(re\)start number=2, log rollover=1' -E
54 grep_for_stall rstart
55
56 purge