-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
job-runner: move async one level up in the call stack
* The job_runner was converted to async, its tasks run in the background (i.e. calls complete before the code has finished running, you cannot await them from synchronous code). * This jiggered up some `finally` blocks which were being invoked too soon. * This PR moves the async code up one level in the stack, brining these finally blocks within the lifecycle of the job runner async code allowing them to function correctly. * Closes #2784
- Loading branch information
1 parent
b4f653f
commit d3ec050
Showing
4 changed files
with
110 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/env bash | ||
#------------------------------------------------------------------------------- | ||
# Copyright (C) British Crown (Met Office) & Contributors. | ||
# | ||
# This file is part of Rose, a framework for meteorological suites. | ||
# | ||
# Rose 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. | ||
# | ||
# Rose 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 Rose. If not, see <http://www.gnu.org/licenses/>. | ||
#------------------------------------------------------------------------------- | ||
# Test Rose file installation under "cylc install" | ||
# * Rose file installation is tested under "rose app-run" / "rose task-run", | ||
# however, the way the async code is called is different when file | ||
# installation is performed under "cylc install". | ||
# * See https://github.com/metomi/rose/issues/2784 | ||
#------------------------------------------------------------------------------- | ||
. $(dirname $0)/test_header | ||
#------------------------------------------------------------------------------- | ||
tests 3 | ||
|
||
# install a file from the Rose github repository | ||
cat >rose-suite.conf <<__CONF__ | ||
[file:README.md] | ||
source=git:[email protected]:metomi/rose::README.md::master | ||
__CONF__ | ||
|
||
touch flow.cylc | ||
get_reg | ||
|
||
# install the workflow | ||
TEST_KEY="${TEST_KEY_BASE}-install" | ||
run_pass "$TEST_KEY" \ | ||
cylc install \ | ||
--workflow-name="${FLOW}" \ | ||
--no-run-name \ | ||
. | ||
|
||
# ensure no error was produced during file installation | ||
file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null | ||
|
||
# check the README file was produced | ||
run_pass "${TEST_KEY_BASE}-foo" stat $HOME/cylc-run/$FLOW/README.md | ||
|
||
purge | ||
exit 0 |
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 @@ | ||
../lib/bash/test_header |