Skip to content

Commit

Permalink
response to review
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Dec 6, 2024
1 parent ab3bd1c commit fc12804
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
6 changes: 2 additions & 4 deletions cylc/flow/task_events_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1324,6 +1324,7 @@ def _process_message_failed(
"run_status": 1,
"time_run_exit": event_time,
})
LOG.error(f'[{itask}] {full_message or self.EVENT_FAILED}')
if (
forced
or TimerFlags.EXECUTION_RETRY not in itask.try_timers
Expand All @@ -1338,9 +1339,6 @@ def _process_message_failed(
self.data_store_mgr.delta_task_output(
itask, TASK_OUTPUT_FAILED)
self.data_store_mgr.delta_task_state(itask)
LOG.error(
f'[{itask}] {full_message or self.EVENT_FAILED}'
)
else:
# There is an execution retry lined up.
timer = itask.try_timers[TimerFlags.EXECUTION_RETRY]
Expand Down Expand Up @@ -1428,6 +1426,7 @@ def _process_message_submit_failed(
"submit_status": 1,
})
itask.summary['submit_method_id'] = None
LOG.error(f"[{itask}] {self.EVENT_SUBMIT_FAILED}")
if (
forced
or TimerFlags.SUBMISSION_RETRY not in itask.try_timers
Expand All @@ -1446,7 +1445,6 @@ def _process_message_submit_failed(
self.data_store_mgr.delta_task_output(
itask, TASK_OUTPUT_SUBMIT_FAILED)
self.data_store_mgr.delta_task_state(itask)
LOG.error(f"[{itask}] {self.EVENT_SUBMIT_FAILED}")
else:
# There is a submission retry lined up.
timer = itask.try_timers[TimerFlags.SUBMISSION_RETRY]
Expand Down
12 changes: 5 additions & 7 deletions tests/integration/test_task_events_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ async def test__always_insert_task_job(
}


async def test__process_message_failed_with_retry(one, start):
async def test__process_message_failed_with_retry(one, start, log_filter):
"""Log job failure, even if a retry is scheduled.
See: https://github.com/cylc/cylc-flow/pull/6169
Expand All @@ -199,9 +199,8 @@ async def test__process_message_failed_with_retry(one, start):

one.task_events_mgr._process_message_submit_failed(
fail_once, None, 2, False)
last_record = LOG.records[-1]
assert last_record.levelno == logging.ERROR
assert 'submission failed' in last_record.message
failed_record = log_filter(LOG, level=logging.ERROR)[-1]
assert 'submission failed' in failed_record[2]

# Process failed message with and without retries:
one.task_events_mgr._process_message_failed(
Expand All @@ -212,6 +211,5 @@ async def test__process_message_failed_with_retry(one, start):

one.task_events_mgr._process_message_failed(
fail_once, None, 'failed', False, 'failed/OOK')
last_record = LOG.records[-1]
assert last_record.levelno == logging.ERROR
assert 'failed/OOK' in last_record.message
failed_record = log_filter(LOG, level=logging.ERROR)[-1]
assert 'failed/OOK' in failed_record[2]

0 comments on commit fc12804

Please sign in to comment.