-
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
reload: preserve retry xtriggers on reload #5040
Merged
Merged
Changes from all commits
Commits
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/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/>. | ||
#------------------------------------------------------------------------------- | ||
|
||
# Ensure that xtriggers are preserved after reloads | ||
# See https://github.com/cylc/cylc-flow/issues/4866 | ||
|
||
. "$(dirname "$0")/test_header" | ||
|
||
set_test_number 6 | ||
|
||
init_workflow "${TEST_NAME_BASE}" <<'__FLOW_CONFIG__' | ||
[scheduling] | ||
[[graph]] | ||
R1 = """ | ||
broken | ||
reload | ||
""" | ||
|
||
[runtime] | ||
[[broken]] | ||
script = false | ||
# should be long enough for the reload to complete | ||
# (annoyingly we can't make this event driven) | ||
execution retry delays = PT1M | ||
# NOTE: "execution retry delays" is implemented as an xtrigger | ||
|
||
[[reload]] | ||
script = """ | ||
# wait for "broken" to fail | ||
cylc__job__poll_grep_workflow_log \ | ||
'1/broken .* (received)failed/ERR' | ||
# fix "broken" to allow it to pass | ||
sed -i 's/false/true/' "${CYLC_WORKFLOW_RUN_DIR}/flow.cylc" | ||
# reload the workflow | ||
cylc reload "${CYLC_WORKFLOW_ID}" | ||
""" | ||
__FLOW_CONFIG__ | ||
|
||
run_ok "${TEST_NAME_BASE}-val" cylc validate "${WORKFLOW_NAME}" | ||
workflow_run_ok "${TEST_NAME_BASE}-run" cylc play "${WORKFLOW_NAME}" --no-detach | ||
|
||
# ensure the following order of events | ||
# 1. "1/broken" fails | ||
# 2. workflow is reloaded (by "1/reload") | ||
# 3. the retry xtrigger for "1/broken" becomes satisfied (after the reload) | ||
# (thus proving that the xtrigger survived the reload) | ||
# 4. "1/broken" succeeds | ||
log_scan "${TEST_NAME_BASE}-scan" \ | ||
"$(cylc cat-log -m p "${WORKFLOW_NAME}")" \ | ||
1 1 \ | ||
'1/broken .* (received)failed/ERR' \ | ||
'Command succeeded: reload_workflow()' \ | ||
'xtrigger satisfied: _cylc_retry_1/broken' \ | ||
'1/broken .* (received)succeeded' | ||
|
||
purge | ||
exit |
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.
Would it be worth moving this test into
tests/flakyfunctional
and possibly cutting down this delay, in order that it doesn't hog time in thetests/functional
runs on GH Actions?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.
No evidence that it's flaky, yet, so no need to bump it in there.
(FYI: flakyfunction is kinda pointless, not all flakyfunctional tests are flaky and not all functional tests aren't, would like to get rid of this one day...).
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.
I know, just conscious of the fact we are approaching the timeout limit on GH Actions. May have to either increase the limit or add an extra chunk soon