3939from cylc .flow .cycling .integer import IntegerPoint
4040from cylc .flow .scheduler import Scheduler
4141from cylc .flow .task_state import (
42- TASK_STATUS_PREPARING ,
4342 TASK_STATUS_FAILED ,
4443 TASK_STATUS_RUNNING ,
4544 TASK_STATUS_SUBMITTED ,
@@ -696,7 +695,7 @@ async def test_trigger_with_sequential_task(flow, scheduler, run, log_filter):
696695 await asyncio .sleep (0 )
697696
698697
699- async def test_trigger_whilst_paused_preparing (flow , scheduler , run , complete ):
698+ async def test_trigger_whilst_paused_preparing (one , run , complete ):
700699 """It should run "preparing" tasks even if the workflow is paused.
701700
702701 Remote init leaves tasks as preparing for a while. These must still be
@@ -705,22 +704,15 @@ async def test_trigger_whilst_paused_preparing(flow, scheduler, run, complete):
705704 See https://github.com/cylc/cylc-flow/pull/6768
706705
707706 """
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 )
707+ async with run (one ):
708+ await run_cmd (
709+ force_trigger_tasks (
710+ one , [one .pool .get_tasks ()[0 ].tokens .relative_id ], ['1' ]
711+ )
712+ )
721713
722714 # 1/a should run even though the workflow is paused.
723- await complete (schd , '1/a ' , allow_paused = True , timeout = 1 )
715+ await complete (one , '1/one ' , allow_paused = True , timeout = 1 )
724716
725717
726718async def test_trigger_with_task_selector (flow , scheduler , start , monkeypatch ):
0 commit comments