Skip to content

Commit 91c1adf

Browse files
committed
Deconflict post-merge
- All task proxies that are `waiting_on_job_prep` should be in the preparing state, so remove redundant check - Add back in simple trigger-while-paused integration test
1 parent 9401a1a commit 91c1adf

File tree

3 files changed

+28
-21
lines changed

3 files changed

+28
-21
lines changed

cylc/flow/scheduler.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,8 +1355,8 @@ def release_tasks_to_run(self) -> bool:
13551355
pre_prep_tasks.update(self.pool.release_queued_tasks())
13561356

13571357
if (
1358-
# Manually triggered tasks will be in preparing state and should
1359-
# be submitted even if paused (unless stopping).
1358+
# Manually triggered tasks will be preparing and should
1359+
# be submitted even if paused (unless workflow is stopping).
13601360
self.is_paused and not self.stop_mode
13611361
) or (
13621362
# Need to get preparing tasks to submit before auto restart
@@ -1369,8 +1369,7 @@ def release_tasks_to_run(self) -> bool:
13691369
pre_prep_tasks.update({
13701370
itask
13711371
for itask in self.pool.get_tasks()
1372-
if itask.state(TASK_STATUS_PREPARING)
1373-
and itask.waiting_on_job_prep
1372+
if itask.waiting_on_job_prep
13741373
})
13751374

13761375
# Return, if no tasks to submit.

tests/integration/test_force_trigger.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,17 @@
4242
)
4343

4444

45-
async def test_trigger_workflow_paused(
45+
async def test_workflow_paused_simple(
46+
one_conf, flow, scheduler, run, complete
47+
):
48+
"""It should run triggered tasks even if the workflow is paused."""
49+
schd: Scheduler = scheduler(flow(one_conf), paused_start=True)
50+
async with run(schd):
51+
await run_cmd(force_trigger_tasks(schd, ['1/one'], ['1']))
52+
await complete(schd, '1/one', allow_paused=True, timeout=1)
53+
54+
55+
async def test_workflow_paused_queues(
4656
flow: 'Fixture',
4757
scheduler: 'Fixture',
4858
start: 'Fixture',
@@ -111,22 +121,17 @@ async def test_trigger_workflow_paused(
111121

112122

113123
async def test_trigger_group_whilst_paused(flow, scheduler, run, complete):
114-
"""Only group start tasks should run whilst the scheduler is paused.
124+
"""Only group start tasks should run if the group is triggered whilst
125+
the scheduler is paused.
115126
116127
Group start tasks have only off-group dependencies.
117128
118129
Others (with in-group dependencies) should run as normal when their
119130
prerequisites are satisfied once the workflow is resumed.
120131
121132
"""
122-
id_ = flow(
123-
{
124-
'scheduling': {
125-
'graph': {'R1': 'a => b => c => d'},
126-
},
127-
}
128-
)
129-
schd = scheduler(id_)
133+
id_ = flow('a => b => c => d')
134+
schd = scheduler(id_, paused_start=True)
130135
async with run(schd):
131136
# trigger the chain
132137
await run_cmd(force_trigger_tasks(schd, ['1/a'], []))

tests/integration/test_reload.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,20 @@
1616

1717
"""Tests for reload behaviour in the scheduler."""
1818

19-
from contextlib import suppress
2019

21-
from cylc.flow import commands
20+
from cylc.flow import (
21+
commands,
22+
flags,
23+
)
24+
from cylc.flow.cfgspec.glbl_cfg import glbl_cfg
2225
from cylc.flow.data_store_mgr import TASK_PROXIES
26+
from cylc.flow.platforms import get_platform
2327
from cylc.flow.scheduler import Scheduler
2428
from cylc.flow.task_state import (
25-
TASK_STATUS_WAITING,
2629
TASK_STATUS_PREPARING,
2730
TASK_STATUS_SUBMITTED,
31+
TASK_STATUS_WAITING,
2832
)
29-
from cylc.flow.cfgspec.glbl_cfg import glbl_cfg
30-
from cylc.flow.platforms import get_platform
31-
from cylc.flow import flags
3233

3334

3435
async def test_reload_waits_for_pending_tasks(
@@ -68,8 +69,10 @@ async def test_reload_waits_for_pending_tasks(
6869

6970
# set the task to go through some state changes
7071
def submit_task_jobs(*a, **k):
71-
with suppress(IndexError):
72+
try:
7273
foo.state_reset(state_seq.pop(0))
74+
except IndexError:
75+
foo.waiting_on_job_prep = False
7376
return [foo]
7477

7578
monkeypatch.setattr(

0 commit comments

Comments
 (0)