-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Timeout on restarting completed workflows (#5231)
scheduler: add restart timeout for workflows with no tasks in the pool * Don't poll on restart if task pool empty. * restart timeout: add integration test --------- Co-authored-by: Oliver Sanders <oliver.sanders@metoffice.gov.uk> Co-authored-by: Tim Pillinger <26465611+wxtim@users.noreply.github.com> Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com>
- Loading branch information
1 parent
69d5905
commit 4a6b447
Showing
7 changed files
with
214 additions
and
61 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/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/>. | ||
#------------------------------------------------------------------------------- | ||
|
||
# GitHub 5231: Test that a finished workflow waits on a timeout if restarted. | ||
|
||
. "$(dirname "$0")/test_header" | ||
|
||
set_test_number 8 | ||
|
||
install_workflow "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" | ||
|
||
TEST_NAME="${TEST_NAME_BASE}-val" | ||
run_ok "${TEST_NAME}" cylc validate "${WORKFLOW_NAME}" | ||
|
||
# Run to completion. | ||
TEST_NAME="${TEST_NAME_BASE}-run" | ||
workflow_run_ok "${TEST_NAME}" cylc play --no-detach "${WORKFLOW_NAME}" | ||
|
||
# Restart completed workflow: it should stall on a restart timer. | ||
TEST_NAME="${TEST_NAME_BASE}-restart" | ||
run_ok "${TEST_NAME}" cylc play "${WORKFLOW_NAME}" | ||
|
||
# Search log for restart timer. | ||
TEST_NAME="${TEST_NAME_BASE}-grep1" | ||
grep_workflow_log_ok "${TEST_NAME}" "restart timer starts NOW" | ||
|
||
# Check that it has not shut down automatically. | ||
TEST_NAME="${TEST_NAME_BASE}-grep2" | ||
grep_fail "Workflow shutting down" "${WORKFLOW_RUN_DIR}/log/scheduler/log" | ||
|
||
# Retriggering the task should stop the timer, and shut down as complete again. | ||
TEST_NAME="${TEST_NAME_BASE}-trigger" | ||
run_ok "${TEST_NAME}" cylc trigger "${WORKFLOW_NAME}//1/foo" | ||
|
||
poll_grep_workflow_log "Workflow shutting down - AUTOMATIC" | ||
|
||
TEST_NAME="${TEST_NAME_BASE}-grep3" | ||
grep_workflow_log_ok "${TEST_NAME}" "restart timer stopped" | ||
|
||
# It should not be running now. | ||
TEST_NAME="${TEST_NAME_BASE}-ping" | ||
run_fail "${TEST_NAME}" cylc ping "${WORKFLOW_NAME}" | ||
|
||
purge |
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,10 @@ | ||
[scheduler] | ||
[[events]] | ||
inactivity timeout = PT20S | ||
abort on inactivity timeout = True | ||
[scheduling] | ||
[[graph]] | ||
R1 = "foo" | ||
[runtime] | ||
[[foo]] | ||
script = "true" |
Oops, something went wrong.
Why is this now needed?