From 98c7ec3273bbe49265170ee06e5a0c495385e7be Mon Sep 17 00:00:00 2001 From: Hilary James Oliver Date: Wed, 8 Apr 2020 11:52:31 +1200 Subject: [PATCH] Unflaked a new test; style fixes. --- cylc/flow/scheduler.py | 1 + cylc/flow/task_pool.py | 20 ++++++++++---------- tests/hold-release/05-release.t | 3 ++- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/cylc/flow/scheduler.py b/cylc/flow/scheduler.py index f7274c7b380..f36f0cd0a4a 100644 --- a/cylc/flow/scheduler.py +++ b/cylc/flow/scheduler.py @@ -1908,6 +1908,7 @@ def hold_suite(self, point=None): self.pool.hold_all_tasks() self.task_events_mgr.pflag = True self.suite_db_mgr.put_suite_hold() + LOG.info('Suite held.') else: LOG.info( 'Setting suite hold cycle point: %s.' diff --git a/cylc/flow/task_pool.py b/cylc/flow/task_pool.py index 070e36741e7..f281d3cca13 100644 --- a/cylc/flow/task_pool.py +++ b/cylc/flow/task_pool.py @@ -301,13 +301,13 @@ def load_db_task_pool_for_restart(self, row_idx, row): pfin[tuple(json.loads(k))] = v for k, v in itask.parents_finished.items(): try: - itask.parents_finished[k] = pfin[k] + itask.parents_finished[k] = pfin[k] except KeyError: - # P1 = "foo[-P1] => foo" - # Do this: run --hold; stop; restart - #Result: foo will restart held with empty - # parents-finished dict due to pre-initial deps. - pass + # P1 = "foo[-P1] => foo" + # Do this: run --hold; stop; restart + # Result: foo will restart held with empty + # parents-finished dict due to pre-initial deps. + pass itask.state.reset(status) self.add_to_runahead_pool(itask, is_new=False) @@ -1127,7 +1127,7 @@ def trigger_tasks(self, items, back_out=False): point_str, name_str = self._parse_task_item(item)[:2] if point_str is None: LOG.warning( - "%s: task ID for trigger must contain cycle point" % (item)) + "%s: task ID for trigger must contain cycle point" % item) n_warnings += 1 continue try: @@ -1145,11 +1145,11 @@ def trigger_tasks(self, items, back_out=False): for taskdef in taskdefs: task_items[(taskdef.name, point_str)] = taskdef select_args.append((taskdef.name, point_str)) - + for name, point_str in select_args: self.spawn( - 'None', 'None', name, - get_point(point_str).standardise(), go=True) + 'None', 'None', name, + get_point(point_str).standardise(), go=True) return # ------ # TODO DELETE OLD SOS STUFF after checking what's needed. diff --git a/tests/hold-release/05-release.t b/tests/hold-release/05-release.t index 772e0492f99..1ae5905f997 100755 --- a/tests/hold-release/05-release.t +++ b/tests/hold-release/05-release.t @@ -34,6 +34,7 @@ init_suite "${TEST_NAME_BASE}" <<'__SUITERC__' script = """ wait cylc hold $CYLC_SUITE_NAME +cylc__job__poll_grep_suite_log 'Suite held.' cylc release ${CYLC_SUITE_NAME} '*FF.1' # inexact fam cylc release ${CYLC_SUITE_NAME} 'TOAST.1' # exact fam cylc release ${CYLC_SUITE_NAME} 'cat*.1' # inexact tasks @@ -70,7 +71,7 @@ run_ok "${TEST_NAME_BASE}-val" cylc validate "${SUITE_NAME}" suite_run_ok "${TEST_NAME_BASE}-run" cylc run --debug --no-detach "${SUITE_NAME}" -# Should shut down with all the held tasks in the held state, and dog.2 +# Should shut down with all non-released tasks in the held state, and dog1.1 # finished and gone from the task pool. sqlite3 "${SUITE_RUN_DIR}/log/db" \