-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix suicide trigger & logic #2656
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8f31612
Fix suicide trigger & logic
matthewrmshin 9785594
More suicide trigger tests
matthewrmshin 784f74d
More tests on suicide trigger
matthewrmshin 0605e2c
Remove test that relies on unreliable external
matthewrmshin 6e8249c
Modify `&` task:outputs => suicide trigger test
matthewrmshin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
# THIS FILE IS PART OF THE CYLC SUITE ENGINE. | ||
# Copyright (C) 2008-2018 NIWA | ||
# | ||
# 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/>. | ||
#------------------------------------------------------------------------------- | ||
# cylc.conditional_simplifier doctest | ||
. "$(dirname "$0")/test_header" | ||
set_test_number 1 | ||
|
||
run_ok "${TEST_NAME_BASE}" python -m 'cylc.conditional_simplifier' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
# THIS FILE IS PART OF THE CYLC SUITE ENGINE. | ||
# Copyright (C) 2008-2018 NIWA | ||
# | ||
# 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/>. | ||
#------------------------------------------------------------------------------- | ||
# Test "and" outputs from 2 tasks triggering suicide. | ||
# https://github.com/cylc/cylc/issues/2655 | ||
. "$(dirname "$0")/test_header" | ||
set_test_number 3 | ||
install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" | ||
|
||
run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" | ||
suite_run_fail "${TEST_NAME_BASE}-run" \ | ||
cylc run --reference-test --debug --no-detach "${SUITE_NAME}" | ||
if which 'sqlite3' >'/dev/null'; then | ||
DBFILE="$(cylc get-global-config --print-run-dir)/${SUITE_NAME}/log/db" | ||
sqlite3 "${DBFILE}" 'SELECT * FROM task_pool ORDER BY name;' >'sqlite3.out' | ||
cmp_ok 'sqlite3.out' <<'__OUT__' | ||
1|t0|1|succeeded| | ||
1|t1|1|failed| | ||
1|t2|1|succeeded| | ||
__OUT__ | ||
else | ||
skip 1 "sqlite3 not installed?" | ||
fi | ||
|
||
purge_suite "${SUITE_NAME}" | ||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
2018-05-08T15:09:34Z INFO - Initial point: 1 | ||
2018-05-08T15:09:34Z INFO - Final point: 1 | ||
2018-05-08T15:09:34Z INFO - [t0.1] -triggered off [] | ||
2018-05-08T15:09:34Z INFO - [t1.1] -triggered off [] | ||
2018-05-08T15:09:47Z INFO - [t2.1] -triggered off ['t0.1'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[cylc] | ||
UTC mode = True | ||
[[events]] | ||
abort on stalled = True | ||
[[reference test]] | ||
expected task failures = t1.1 | ||
[scheduling] | ||
[[dependencies]] | ||
graph = """ | ||
t0:failed & t1:failed => !t2 | ||
t0 | t1 => t2 | ||
""" | ||
[runtime] | ||
[[t0]] | ||
# https://github.com/cylc/cylc/issues/2655 | ||
# "t2.1" should not suicide on "t1.1:failed" | ||
script = sleep 10 | ||
[[t1]] | ||
script = false | ||
[[t2]] | ||
script = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
# THIS FILE IS PART OF THE CYLC SUITE ENGINE. | ||
# Copyright (C) 2008-2018 NIWA | ||
# | ||
# 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/>. | ||
#------------------------------------------------------------------------------- | ||
# Test "and" outputs from same task triggering suicide. | ||
. "$(dirname "$0")/test_header" | ||
set_test_number 3 | ||
install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" | ||
|
||
run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}" | ||
suite_run_ok "${TEST_NAME_BASE}-run" \ | ||
cylc run --reference-test --debug --no-detach "${SUITE_NAME}" | ||
if which 'sqlite3' >'/dev/null'; then | ||
DBFILE="$(cylc get-global-config --print-run-dir)/${SUITE_NAME}/log/db" | ||
sqlite3 "${DBFILE}" 'SELECT * FROM task_pool ORDER BY cycle, name;' \ | ||
>'sqlite3.out' | ||
cmp_ok 'sqlite3.out' <<'__OUT__' | ||
2|fin|1|succeeded| | ||
3|bad|1|succeeded| | ||
3|fin|1|succeeded| | ||
3|good|1|succeeded| | ||
3|showdown|1|succeeded| | ||
__OUT__ | ||
else | ||
skip 1 "sqlite3 not installed?" | ||
fi | ||
|
||
purge_suite "${SUITE_NAME}" | ||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
2018-05-08T15:09:34Z INFO - Initial point: 1 | ||
2018-05-08T15:09:34Z INFO - Final point: 3 | ||
2017-12-27T14:42:10Z INFO - [showdown.1] -triggered off [] | ||
2017-12-27T14:42:13Z INFO - [bad.1] -triggered off ['showdown.1'] | ||
2017-12-27T14:42:13Z INFO - [ugly.1] -triggered off ['showdown.1'] | ||
2017-12-27T14:42:16Z INFO - [fin.1] -triggered off ['bad.1', 'ugly.1'] | ||
2017-12-27T14:42:19Z INFO - [showdown.2] -triggered off ['fin.1'] | ||
2017-12-27T14:42:22Z INFO - [good.2] -triggered off ['showdown.2'] | ||
2017-12-27T14:42:22Z INFO - [ugly.2] -triggered off ['showdown.2'] | ||
2017-12-27T14:42:25Z INFO - [fin.2] -triggered off ['good.2', 'ugly.2'] | ||
2017-12-27T14:42:28Z INFO - [showdown.3] -triggered off ['fin.2'] | ||
2017-12-27T14:42:32Z INFO - [bad.3] -triggered off ['showdown.3'] | ||
2017-12-27T14:42:32Z INFO - [good.3] -triggered off ['showdown.3'] | ||
2017-12-27T14:42:35Z INFO - [fin.3] -triggered off ['bad.3', 'good.3'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
[cylc] | ||
UTC mode = True | ||
[[events]] | ||
abort on stalled = True | ||
[scheduling] | ||
cycling mode = integer | ||
initial cycle point = 1 | ||
final cycle point = 3 | ||
[[dependencies]] | ||
[[[P1]]] | ||
graph = """ | ||
fin[-P1] => showdown | ||
|
||
showdown:good => good & ! bad & ! ugly | ||
showdown:bad => bad & ! good & ! ugly | ||
showdown:ugly => ugly & ! good & ! bad | ||
|
||
# Note: The above implies: | ||
# showdown:good => good | ||
# showdown:bad => bad | ||
# showdown:ugly => ugly | ||
# showdown:good & showdown:bad => ! ugly | ||
# showdown:good & showdown:ugly => ! bad | ||
# showdown:bad & showdown:ugly => ! good | ||
|
||
good | bad | ugly => fin | ||
""" | ||
[runtime] | ||
[[showdown]] | ||
script = """ | ||
if ((${CYLC_TASK_CYCLE_POINT} == 1)); then | ||
cylc message -- "${CYLC_SUITE_NAME}" "${CYLC_TASK_JOB}" 'bad' 'ugly' | ||
elif ((${CYLC_TASK_CYCLE_POINT} == 2)); then | ||
cylc message -- "${CYLC_SUITE_NAME}" "${CYLC_TASK_JOB}" 'good' 'ugly' | ||
else | ||
cylc message -- "${CYLC_SUITE_NAME}" "${CYLC_TASK_JOB}" 'good' 'bad' | ||
fi | ||
""" | ||
[[[outputs]]] | ||
good = good | ||
bad = bad | ||
ugly = ugly | ||
[[good, bad, ugly, fin]] | ||
script = true |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use of
itask.state.suicide_prerequisites_are_all_satisfied
is purposeful. This may cause issues where multiple suicide triggers are used in combination, see https://github.com/cylc/cylc/pull/2523/files#diff-9e759d26a5f403f3e52c71605f48269cR966.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I cannot see how you can change it to not break this case - when the prerequisite list implies the
&
logic.