job log retrieval: remove duplicate logging#6934
Merged
ChrisPaulBennett merged 1 commit intocylc:8.5.xfrom Sep 3, 2025
Merged
Conversation
Member
|
One unit test needs adapting to the change. |
5f9091d to
1c4e2f2
Compare
oliver-sanders
commented
Aug 26, 2025
Comment on lines
-29
to
-45
| @patch("cylc.flow.task_events_mgr.LOG") | ||
| def test_log_error_on_error_exit_code(cylc_log): | ||
| """Test that an error log is emitted when the log retrieval command | ||
| exited with a code different than zero. | ||
|
|
||
| :param cylc_log: mocked cylc logger | ||
| :type cylc_log: mock.MagicMock | ||
| """ | ||
| task_events_manager = TaskEventsManager( | ||
| None, None, None, None, None, None, None, None, None) | ||
| proc_ctx = SubProcContext( | ||
| cmd_key=None, cmd="error", ret_code=1, err="Error!", id_keys=[]) | ||
| task_events_manager._job_logs_retrieval_callback(proc_ctx, None) | ||
| assert cylc_log.error.call_count == 1 | ||
| assert cylc_log.error.call_args.contains("Error!") | ||
|
|
||
|
|
Member
Author
There was a problem hiding this comment.
Already covered by subprocpool tests, we don't need to test this specifically for job log retrieval commands.
1c4e2f2 to
0c0c82f
Compare
oliver-sanders
commented
Aug 29, 2025
Comment on lines
-46
to
-60
| @patch("cylc.flow.task_events_mgr.LOG") | ||
| def test_log_debug_on_noerror_exit_code(cylc_log): | ||
| """Test that a debug log is emitted when the log retrieval command | ||
| exited with an non-error code (i.e. 0). | ||
|
|
||
| :param cylc_log: mocked cylc logger | ||
| :type cylc_log: mock.MagicMock | ||
| """ | ||
| task_events_manager = TaskEventsManager( | ||
| None, None, None, None, None, None, None, None, None) | ||
| proc_ctx = SubProcContext( | ||
| cmd_key=None, cmd="ls /tmp/123", ret_code=0, err="", id_keys=[]) | ||
| task_events_manager._job_logs_retrieval_callback(proc_ctx, None) | ||
| assert cylc_log.debug.call_count == 1 | ||
| assert cylc_log.debug.call_args.contains("ls /tmp/123") |
hjoliver
approved these changes
Aug 31, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
All subprocs are already logged at DEBUG level by the subprocpool:
cylc-flow/cylc/flow/subprocpool.py
Lines 250 to 252 in 3706f18
So no need to repeat that just for job-log-retrieval.
Check List
CONTRIBUTING.mdand added my name as a Code Contributor.setup.cfg(andconda-environment.ymlif present).?.?.xbranch.