|
42 | 42 | ) |
43 | 43 |
|
44 | 44 |
|
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( |
46 | 56 | flow: 'Fixture', |
47 | 57 | scheduler: 'Fixture', |
48 | 58 | start: 'Fixture', |
@@ -111,22 +121,17 @@ async def test_trigger_workflow_paused( |
111 | 121 |
|
112 | 122 |
|
113 | 123 | 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. |
115 | 126 |
|
116 | 127 | Group start tasks have only off-group dependencies. |
117 | 128 |
|
118 | 129 | Others (with in-group dependencies) should run as normal when their |
119 | 130 | prerequisites are satisfied once the workflow is resumed. |
120 | 131 |
|
121 | 132 | """ |
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) |
130 | 135 | async with run(schd): |
131 | 136 | # trigger the chain |
132 | 137 | await run_cmd(force_trigger_tasks(schd, ['1/a'], [])) |
@@ -186,7 +191,7 @@ async def test_trigger_group( |
186 | 191 | }, |
187 | 192 | } |
188 | 193 | id_ = flow(cfg) |
189 | | - schd = scheduler(id_, paused_start=False) |
| 194 | + schd = scheduler(id_) |
190 | 195 | async with run(schd, level=logging.INFO) as log: |
191 | 196 | # Trigger the group ahead of the flow. |
192 | 197 | # It should run the group and flow on to downstream task e. |
@@ -312,7 +317,7 @@ async def test_trigger_active_task_in_group( |
312 | 317 | }, |
313 | 318 | } |
314 | 319 | id_ = flow(conf) |
315 | | - schd = scheduler(id_, paused_start=False) |
| 320 | + schd = scheduler(id_) |
316 | 321 |
|
317 | 322 | async with run(schd): |
318 | 323 | # capture triggering information |
@@ -398,7 +403,7 @@ async def test_trigger_group_in_flow( |
398 | 403 | } |
399 | 404 | } |
400 | 405 | }) |
401 | | - schd = scheduler(id_, paused_start=False) |
| 406 | + schd = scheduler(id_) |
402 | 407 | async with run(schd): |
403 | 408 | # prevent shutdown after 1/c completes |
404 | 409 | await run_cmd(hold(schd, ['1/d'])) |
@@ -498,7 +503,7 @@ async def test_trigger_n0_tasks( |
498 | 503 | } |
499 | 504 | } |
500 | 505 | }) |
501 | | - schd = scheduler(id_, paused_start=False) |
| 506 | + schd = scheduler(id_) |
502 | 507 | async with run(schd): |
503 | 508 | # cylc hold 1/x |
504 | 509 | await run_cmd(hold(schd, ['1/x'])) |
@@ -665,7 +670,7 @@ async def test_trigger_with_sequential_task(flow, scheduler, run, log_filter): |
665 | 670 | }, |
666 | 671 | }, |
667 | 672 | }) |
668 | | - schd = scheduler(id_, paused_start=False) |
| 673 | + schd = scheduler(id_) |
669 | 674 | async with run(schd): |
670 | 675 | # wait for 2/foo:failed |
671 | 676 | async with asyncio.timeout(5): |
|
0 commit comments