From c00dfe92581d8f83f6f0a91ac84612b61a3ea8bd Mon Sep 17 00:00:00 2001 From: Hilary James Oliver Date: Wed, 17 Jan 2024 15:54:32 +1300 Subject: [PATCH] Don't log pre-incremented submit numbers. --- cylc/flow/task_proxy.py | 8 +++++++- tests/flakyfunctional/hold-release/14-hold-kill/flow.cylc | 2 +- tests/functional/hold-release/11-retrying/flow.cylc | 8 ++++---- .../functional/pause-resume/12-pause-then-retry/flow.cylc | 4 ++-- tests/integration/test_reload.py | 2 +- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/cylc/flow/task_proxy.py b/cylc/flow/task_proxy.py index 34d174f77df..062c80dbbe2 100644 --- a/cylc/flow/task_proxy.py +++ b/cylc/flow/task_proxy.py @@ -287,8 +287,14 @@ def __str__(self) -> str: Format: "//{}:status". """ + if self.state.status == TASK_STATUS_WAITING: + # Don't print pre-incremented submit number. + subnum= "__" + else: + subnum = f"{self.submit_num:02d}" + return ( - f"{self.identity}/{self.submit_num:02d}" + f"{self.identity}/{subnum}" f"{stringify_flow_nums(self.flow_nums)}:{self.state}" ) diff --git a/tests/flakyfunctional/hold-release/14-hold-kill/flow.cylc b/tests/flakyfunctional/hold-release/14-hold-kill/flow.cylc index 26637541125..bdd82878ab1 100644 --- a/tests/flakyfunctional/hold-release/14-hold-kill/flow.cylc +++ b/tests/flakyfunctional/hold-release/14-hold-kill/flow.cylc @@ -9,7 +9,7 @@ echo '# killing "sleeper"' cylc kill "${CYLC_WORKFLOW_ID}//1/sleeper" cylc__job__poll_grep_workflow_log -E \ - '1/sleeper/01: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' diff --git a/tests/functional/hold-release/11-retrying/flow.cylc b/tests/functional/hold-release/11-retrying/flow.cylc index 0fe7d68eee7..61873f24da8 100644 --- a/tests/functional/hold-release/11-retrying/flow.cylc +++ b/tests/functional/hold-release/11-retrying/flow.cylc @@ -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/01: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/01: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/01:waiting\(held\).* => waiting' + '1/t-retry-able/__:waiting\(held\).* => waiting' cylc__job__poll_grep_workflow_log -E \ - '1/t-retry-able/01:waiting.* => waiting\(queued\)' + '1/t-retry-able/__:waiting.* => waiting\(queued\)' """ [[t-analyse]] script = """ diff --git a/tests/functional/pause-resume/12-pause-then-retry/flow.cylc b/tests/functional/pause-resume/12-pause-then-retry/flow.cylc index 00d778890a1..aec3bdd9b18 100644 --- a/tests/functional/pause-resume/12-pause-then-retry/flow.cylc +++ b/tests/functional/pause-resume/12-pause-then-retry/flow.cylc @@ -36,10 +36,10 @@ cylc play "${CYLC_WORKFLOW_ID}" cylc__job__poll_grep_workflow_log -E \ - '1/t-retry-able/01:waiting.* => waiting\(queued\)' + '1/t-retry-able/__:waiting.* => waiting\(queued\)' cylc__job__poll_grep_workflow_log -E \ - '1/t-submit-retry-able/01:waiting.* => waiting\(queued\)' + '1/t-submit-retry-able/__:waiting.* => waiting\(queued\)' """ [[t-retry-able]] script = """ diff --git a/tests/integration/test_reload.py b/tests/integration/test_reload.py index 6f3c0a7155d..ee8f0e24472 100644 --- a/tests/integration/test_reload.py +++ b/tests/integration/test_reload.py @@ -99,7 +99,7 @@ def change_state(_=0): [ # the task should have entered the preparing state before the # reload was requested - '[1/foo/00: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