-
Notifications
You must be signed in to change notification settings - Fork 96
cat-log: infer --force-remote for --mode=list-dir if job.out not present #6933
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
Merged
oliver-sanders
merged 14 commits into
cylc:master
from
ChrisPaulBennett:6596-force-remote
Oct 23, 2025
Merged
Changes from 9 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
17825ff
initial commit
ChrisPaulBennett 97f0007
Fix implemented and tests created
ChrisPaulBennett a7d9fca
Update cylc/flow/scripts/cat_log.py
ChrisPaulBennett 46683a2
Typo
ChrisPaulBennett 4a80996
Fixing race condition
ChrisPaulBennett 57966df
Adding test for list directory mode
ChrisPaulBennett 09f88a8
Merge branch 'master' into 6596-force-remote
ChrisPaulBennett 64d07c7
Altered unit test to be more robust
ChrisPaulBennett 11704c9
Merge branch 'master' into 6596-force-remote
ChrisPaulBennett a0a413c
Update tests/functional/cylc-cat-log/15-remote_when_no_local_log.t
ChrisPaulBennett 4778cfc
Apply suggestions from code review
ChrisPaulBennett 950d58c
Fixing "going remote" logic as per review changes
ChrisPaulBennett 32d7736
Update cylc/flow/scripts/cat_log.py
ChrisPaulBennett 891053d
linting
ChrisPaulBennett 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 hidden or 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
49 changes: 49 additions & 0 deletions
49
tests/functional/cylc-cat-log/15-remote_when_no_local_log.t
This file contains hidden or 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,49 @@ | ||
| #!/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/>. | ||
| #------------------------------------------------------------------------------- | ||
| # Test "cylc cat-log" for a specific circumstance that caused cat-log to | ||
| # not work properly. This tests simulates small window of time where a | ||
| # workflow has finished but the logs have not yet been retrieved. In this | ||
ChrisPaulBennett marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # situation cat-log should remote log retrieval | ||
ChrisPaulBennett marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| export REQUIRE_PLATFORM='loc:remote' | ||
| . "$(dirname "$0")/test_header" | ||
| #------------------------------------------------------------------------------- | ||
| set_test_number 5 | ||
| create_test_global_config "" " | ||
| [platforms] | ||
| [[${CYLC_TEST_PLATFORM}]] | ||
| retrieve job logs = True" | ||
| install_workflow "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" | ||
| #------------------------------------------------------------------------------- | ||
| TEST_NAME="${TEST_NAME_BASE}-run" | ||
| workflow_run_ok "${TEST_NAME}" \ | ||
| cylc play --debug --no-detach \ | ||
| -s "CYLC_TEST_PLATFORM='${CYLC_TEST_PLATFORM}'" "${WORKFLOW_NAME}" | ||
hjoliver marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| #------------------------------------------------------------------------------- | ||
| # remote | ||
| TEST_NAME=${TEST_NAME_BASE}-no_log_remote | ||
| run_ok "$TEST_NAME" cylc cat-log --debug -f j "${WORKFLOW_NAME}//1/a-task" | ||
| grep_ok "job.out not present, getting job log remotely" "${TEST_NAME}.stderr" | ||
|
|
||
| # remote | ||
| TEST_NAME=${TEST_NAME_BASE}-no_log_remote_list_dir | ||
| run_ok "$TEST_NAME" cylc cat-log --debug --mode=list-dir "${WORKFLOW_NAME}//1/a-task" | ||
| grep_ok "job.out not present, getting job log remotely" "${TEST_NAME}.stderr" | ||
|
|
||
| # Clean up the task host. | ||
| purge | ||
| exit | ||
ChrisPaulBennett marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
19 changes: 19 additions & 0 deletions
19
tests/functional/cylc-cat-log/15-remote_when_no_local_log/flow.cylc
This file contains hidden or 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,19 @@ | ||
| #!Jinja2 | ||
| [scheduler] | ||
| [[events]] | ||
| abort on stall timeout = True | ||
| stall timeout = PT1M | ||
| [scheduling] | ||
| [[graph]] | ||
| R1 = a-task => b-task | ||
| [runtime] | ||
| [[a-task]] | ||
| script = """ | ||
| # Write to task stdout log | ||
| echo "Master, Master! Where are those dreams that I've been after?" | ||
| """ | ||
ChrisPaulBennett marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| platform = {{CYLC_TEST_PLATFORM | default("localhost")}} | ||
| [[b-task]] | ||
| script = """ | ||
| cylc__job__poll_grep_workflow_log 'TaskJobLogsRetrieveContext.*ret_code.*0' | ||
| rm ${CYLC_WORKFLOW_RUN_DIR}/log/job/1/a-task/NN/job.out""" | ||
ChrisPaulBennett marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.