Skip to content

Commit 47da103

Browse files
pause: fix trigger whilst paused logic
* Closes #7016 * The wrong indicator was being used to list tasks for job preparation resulting in duplicate preparation calls.
1 parent 1a3014b commit 47da103

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

changes.d/7054.fix.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix an issue where job submission could fail with the message
2+
`No such file or directory` when tasks were triggered while the workflow was
3+
paused.

cylc/flow/scheduler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,7 @@ def release_tasks_to_run(self) -> bool:
13541354
# finish processing preparing tasks
13551355
pre_prep_tasks.update({
13561356
itask for itask in self.pool.get_tasks()
1357-
if itask.state(TASK_STATUS_PREPARING)
1357+
if itask.waiting_on_job_prep
13581358
})
13591359
else:
13601360
# release queued tasks

tests/integration/test_force_trigger.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ async def test_trigger_with_sequential_task(flow, scheduler, run, log_filter):
696696
await asyncio.sleep(0)
697697

698698

699-
async def test_trigger_whilst_paused_preparing(flow, scheduler, run, complete):
699+
async def test_trigger_whilst_paused_preparing(one, run, complete):
700700
"""It should run "preparing" tasks even if the workflow is paused.
701701
702702
Remote init leaves tasks as preparing for a while. These must still be
@@ -705,22 +705,15 @@ async def test_trigger_whilst_paused_preparing(flow, scheduler, run, complete):
705705
See https://github.com/cylc/cylc-flow/pull/6768
706706
707707
"""
708-
id_ = flow(
709-
{
710-
'scheduling': {
711-
'graph': {'R1': 'a'},
712-
},
713-
}
714-
)
715-
schd = scheduler(id_)
716-
async with run(schd):
717-
718-
# Instead of triggering, artificially set it as preparing.
719-
a = schd.pool.get_tasks()[0]
720-
a.state_reset(TASK_STATUS_PREPARING)
708+
async with run(one):
709+
await run_cmd(
710+
force_trigger_tasks(
711+
one, [one.pool.get_tasks()[0].tokens.relative_id], ['1']
712+
)
713+
)
721714

722715
# 1/a should run even though the workflow is paused.
723-
await complete(schd, '1/a', allow_paused=True, timeout=1)
716+
await complete(one, '1/one', allow_paused=True, timeout=1)
724717

725718

726719
async def test_trigger_with_task_selector(flow, scheduler, start, monkeypatch):

0 commit comments

Comments
 (0)