Skip to content

Commit 2564b21

Browse files
committed
Add simple trigger while paused test
Fix mistake in another test and tidy
1 parent 9401a1a commit 2564b21

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

tests/integration/test_force_trigger.py

Lines changed: 20 additions & 15 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'], []))
@@ -186,7 +191,7 @@ async def test_trigger_group(
186191
},
187192
}
188193
id_ = flow(cfg)
189-
schd = scheduler(id_, paused_start=False)
194+
schd = scheduler(id_)
190195
async with run(schd, level=logging.INFO) as log:
191196
# Trigger the group ahead of the flow.
192197
# It should run the group and flow on to downstream task e.
@@ -312,7 +317,7 @@ async def test_trigger_active_task_in_group(
312317
},
313318
}
314319
id_ = flow(conf)
315-
schd = scheduler(id_, paused_start=False)
320+
schd = scheduler(id_)
316321

317322
async with run(schd):
318323
# capture triggering information
@@ -398,7 +403,7 @@ async def test_trigger_group_in_flow(
398403
}
399404
}
400405
})
401-
schd = scheduler(id_, paused_start=False)
406+
schd = scheduler(id_)
402407
async with run(schd):
403408
# prevent shutdown after 1/c completes
404409
await run_cmd(hold(schd, ['1/d']))
@@ -498,7 +503,7 @@ async def test_trigger_n0_tasks(
498503
}
499504
}
500505
})
501-
schd = scheduler(id_, paused_start=False)
506+
schd = scheduler(id_)
502507
async with run(schd):
503508
# cylc hold 1/x
504509
await run_cmd(hold(schd, ['1/x']))
@@ -665,7 +670,7 @@ async def test_trigger_with_sequential_task(flow, scheduler, run, log_filter):
665670
},
666671
},
667672
})
668-
schd = scheduler(id_, paused_start=False)
673+
schd = scheduler(id_)
669674
async with run(schd):
670675
# wait for 2/foo:failed
671676
async with asyncio.timeout(5):

0 commit comments

Comments
 (0)