Skip to content

Commit

Permalink
Clean up task logging prefix.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoliver committed Jan 20, 2024
1 parent 7545b53 commit e8954cf
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cylc/flow/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ def log_start(self) -> None:
# Note that the following lines must be present at the top of
# the workflow log file for use in reference test runs.
LOG.info(
"Task log format: [CYCLE/TASK/JOB(FLOWS):STATUS] - LOG MESSAGE"
"Task log prefix: CYCLE/TASK[/JOB][(FLOWS)]:STATUS"
)
LOG.info(
f'Run mode: {self.config.run_mode()}',
Expand Down
11 changes: 4 additions & 7 deletions cylc/flow/task_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,12 @@ def __str__(self) -> str:
Format: "<point>/<name>/<job>{<flows>}:status".
"""
if self.state.status == TASK_STATUS_WAITING:
# Don't print pre-incremented submit number.
subnum = "__"
else:
subnum = f"{self.submit_num:02d}"
id_ = self.identity
if self.state.status != TASK_STATUS_WAITING:
id_ += f"/{self.submit_num:02d}"

return (
f"{self.identity}/{subnum}"
f"{stringify_flow_nums(self.flow_nums)}:{self.state}"
f"{id_}{stringify_flow_nums(self.flow_nums)}:{self.state}"
)

def copy_to_reload_successor(self, reload_successor, check_output):
Expand Down
2 changes: 1 addition & 1 deletion tests/flakyfunctional/hold-release/14-hold-kill/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
echo '# killing "sleeper"'
cylc kill "${CYLC_WORKFLOW_ID}//1/sleeper"
cylc__job__poll_grep_workflow_log -E \
'1/sleeper/__:waiting\(held\).* job killed'
'1/sleeper:waiting\(held\).* job killed'
sleep 10 # sleep, should still be held after 10 seconds
cylc dump -s -t "${CYLC_WORKFLOW_ID}" >'cylc-dump.out'
Expand Down
8 changes: 4 additions & 4 deletions tests/functional/hold-release/11-retrying/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ t-retry-able => t-analyse
'1/t-retry-able/01:running.* => waiting'
cylc__job__poll_grep_workflow_log -E \
'1/t-retry-able/__:waiting.* retrying in PT15S'
'1/t-retry-able:waiting.* retrying in PT15S'
cylc hold "${CYLC_WORKFLOW_ID}//1/t-retry-able"
cylc__job__poll_grep_workflow_log -E \
'1/t-retry-able/__:waiting.* => waiting\(held\)'
'1/t-retry-able:waiting.* => waiting\(held\)'
cylc release "${CYLC_WORKFLOW_ID}//1/t-retry-able"
cylc__job__poll_grep_workflow_log -E \
'1/t-retry-able/__:waiting\(held\).* => waiting'
'1/t-retry-able:waiting\(held\).* => waiting'
cylc__job__poll_grep_workflow_log -E \
'1/t-retry-able/__:waiting.* => waiting\(queued\)'
'1/t-retry-able:waiting.* => waiting\(queued\)'
"""
[[t-analyse]]
script = """
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/pause-resume/12-pause-then-retry/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
cylc play "${CYLC_WORKFLOW_ID}"
cylc__job__poll_grep_workflow_log -E \
'1/t-retry-able/__:waiting.* => waiting\(queued\)'
'1/t-retry-able:waiting.* => waiting\(queued\)'
cylc__job__poll_grep_workflow_log -E \
'1/t-submit-retry-able/__:waiting.* => waiting\(queued\)'
'1/t-submit-retry-able:waiting.* => waiting\(queued\)'
"""
[[t-retry-able]]
script = """
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def change_state(_=0):
[
# the task should have entered the preparing state before the
# reload was requested
'[1/foo/__:waiting(queued)] => preparing(queued)',
'[1/foo:waiting(queued)] => preparing(queued)',
# the reload should have put the workflow into the paused state
'Pausing the workflow: Reloading workflow',
# reload should have waited for the task to submit
Expand Down

0 comments on commit e8954cf

Please sign in to comment.