Skip to content

Commit

Permalink
Add new functional test.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoliver committed Oct 13, 2021
1 parent d3604c2 commit c524cb6
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/functional/spawn-on-demand/11-abs-suicide.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------

# Check that absolute suicide triggers clean up unsatisfied prerequisites.
# See explanatory comments in the workflow config.

. "$(dirname "$0")/test_header"
set_test_number 2
reftest
exit
31 changes: 31 additions & 0 deletions tests/functional/spawn-on-demand/11-abs-suicide/flow.cylc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow spawns instances of c (as partially satsified prerequisites)
# out to the runahead limit before the suicide trigger gets activated. If the
# suicide trigger cleans up all c instances the scheduler can shut down
# cleanly. Otherwise it will abort on stall with unsatisfied prerequisites.

[scheduler]
[[events]]
stall timeout = PT0S
abort on stall timeout = True
expected task failures = a.1

[scheduling]
cycling mode = integer
initial cycle point = 1
final cycle point = 5
runahead limit = P5
[[graph]]
R1 = "a?"
P1 = """
a[^]? => c & !x
a[^]:fail? => x & !c
b => c & x
"""
[runtime]
[[b,c,x]]
[[a]]
# Fail after c is spawned out to the runahead limit.
script = """
cylc__job__poll_grep_workflow_log "spawned c\.5"
false
"""
13 changes: 13 additions & 0 deletions tests/functional/spawn-on-demand/11-abs-suicide/reference.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Initial point: 1
Final point: 5
[a.1] -triggered off []
[b.1] -triggered off []
[b.2] -triggered off []
[b.3] -triggered off []
[b.4] -triggered off []
[b.5] -triggered off []
[x.1] -triggered off ['a.1', 'b.1']
[x.4] -triggered off ['a.1', 'b.4']
[x.2] -triggered off ['a.1', 'b.2']
[x.3] -triggered off ['a.1', 'b.3']
[x.5] -triggered off ['a.1', 'b.5']

0 comments on commit c524cb6

Please sign in to comment.