Debian Codegraph @

tests/functional/execution-time-limit/04-polling-intervals.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 execution time limit works correctly with polling intervals
19
20 . "$(dirname "$0")/test_header"
21 set_test_number 6
22
23 init_workflow "${TEST_NAME_BASE}" << __FLOW__
24 [scheduling]
25 [[graph]]
26 R1 = nolimit & limit95M & limit1H & limit10M & limit70S
27 [runtime]
28 [[root]]
29 script = "echo Hello"
30 execution polling intervals = 3*PT30S, PT10M, PT1H
31 [[nolimit]]
32 [[limit95M]]
33 execution time limit = PT95M
34 [[limit1H]]
35 execution time limit = PT1H
36 [[limit10M]]
37 execution time limit = PT10M
38 [[limit70S]]
39 execution time limit = PT70S
40 __FLOW__
41
42 run_ok "${TEST_NAME_BASE}-validate" cylc validate "${WORKFLOW_NAME}"
43
44 cylc play --debug "${WORKFLOW_NAME}"
45
46 poll_grep_workflow_log "INFO - DONE"
47
48 # NOTE: execution timeout polling is delayed by PT1M to let things settle
49 # PT10M = (3*PT3S + PT9M30S) - PT1M
50 grep_workflow_log_ok grep-limit10M "\[1/limit10M/01:running\] health: execution timeout=None, polling intervals=3\*PT30S,PT9M30S,PT2M,PT7M,..."
51 # PT60M = (3*PT3S + PT10M + PT49M30S) - PT1M
52 grep_workflow_log_ok grep-limit1H "\[1/limit1H/01:running\] health: execution timeout=None, polling intervals=3\*PT30S,PT10M,PT49M30S,PT2M,PT7M,..."
53 # PT70S = (2*PT30S + PT1M10S) - PT1M
54 grep_workflow_log_ok grep-limit70S "\[1/limit70S/01:running\] health: execution timeout=None, polling intervals=2\*PT30S,PT1M10S,PT2M,PT7M,..."
55 # PT95M = (3*PT3S + PT10M + PT1H + PT24M30S) - PT1M
56 grep_workflow_log_ok grep-limit95M "\[1/limit95M/01:running\] health: execution timeout=None, polling intervals=3\*PT30S,PT10M,PT1H,PT24M30S,PT2M,PT7M,..."
57 grep_workflow_log_ok grep-no-limit "\[1/nolimit/01:running\] health: execution timeout=None, polling intervals=3\*PT30S,PT10M,PT1H,..."
58
59 purge