Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Sep 24, 2024
1 parent 6fa0ca8 commit 1f9d3e2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
4 changes: 0 additions & 4 deletions cylc/flow/run_modes/skip.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ def submit_task_job(
Returns:
True - indicating that TaskJobManager need take no further action.
"""
# Don't do anything if task is held:
if itask.state.is_held:
return True

task_job_mgr._set_retry_timers(itask, rtconfig)
itask.summary['started_time'] = now[0]
itask.waiting_on_job_prep = False
Expand Down
29 changes: 12 additions & 17 deletions tests/integration/run_modes/test_skip.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"""Test for skip mode integration.
"""

import asyncio


async def test_settings_override_from_broadcast(
flow, scheduler, start, complete, log_filter
Expand Down Expand Up @@ -164,7 +166,7 @@ async def test_skip_mode_outputs(


async def test_doesnt_release_held_tasks(
one_conf, flow, scheduler, start, log_filter
one_conf, flow, scheduler, run, log_filter, capture_live_submissions
):
"""Point 5 of the proposal
https://github.com/cylc/cylc-admin/blob/master/docs/proposal-skip-mode.md
Expand All @@ -174,32 +176,25 @@ async def test_doesnt_release_held_tasks(
"""
one_conf['runtime'] = {'one': {'run mode': 'skip'}}
schd = scheduler(flow(one_conf), run_mode='live')
async with start(schd) as log:
schd = scheduler(flow(one_conf), run_mode='live', paused_start=False)
async with run(schd) as log:
itask = schd.pool.get_tasks()[0]
msg = 'held tasks shoudn\'t {}'

# Set task to held and check submission in skip mode doesn't happen:
itask.state.is_held = True
schd.task_job_mgr.submit_task_jobs(
schd.workflow,
[itask],
schd.server.curve_auth,
schd.server.client_pub_key_dir,
run_mode=schd.get_run_mode()
)

# Relinquish contol to the main loop.
await asyncio.sleep(1)

assert not log_filter(log, contains='=> running'), msg.format('run')
assert not log_filter(log, contains='=> succeeded'), msg.format(
'succeed')

# Release held task and assert that it now skips successfully:
schd.pool.release_held_tasks(['1/one'])
schd.task_job_mgr.submit_task_jobs(
schd.workflow,
[itask],
schd.server.curve_auth,
schd.server.client_pub_key_dir,
run_mode=schd.get_run_mode()
)
await asyncio.sleep(1)

assert log_filter(log, contains='=> running'), msg.format('run')
assert log_filter(log, contains='=> succeeded'), msg.format('succeed')

Expand Down

0 comments on commit 1f9d3e2

Please sign in to comment.