Skip to content

Commit

Permalink
Unflaked a new test; style fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoliver committed Apr 8, 2020
1 parent 3258e35 commit 98c7ec3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions cylc/flow/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down
20 changes: 10 additions & 10 deletions cylc/flow/task_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand All @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion tests/hold-release/05-release.t
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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" \
Expand Down

0 comments on commit 98c7ec3

Please sign in to comment.