@@ -2342,6 +2342,52 @@ async def test_expire_dequeue_with_retries(
23422342 assert not schd .pool .task_queue_mgr .remove_task (itask )
23432343
23442344
2345+ async def test_clock_expire_with_sequential_xtriggers (
2346+ flow ,
2347+ scheduler ,
2348+ run ,
2349+ complete ,
2350+ log_filter ,
2351+ ):
2352+ """Clock expire should play nicely with sequential xtriggers.
2353+
2354+ See https://github.com/cylc/cylc-flow/issues/7103
2355+ """
2356+ id_ = flow ({
2357+ 'scheduler' : {
2358+ 'cycle point format' : 'CCYY' ,
2359+ },
2360+ 'scheduling' : {
2361+ 'initial cycle point' : '2000' ,
2362+ # v prevent this test passing if sequential spawning gets broken
2363+ 'runahead limit' : 'P2' ,
2364+ 'special tasks' : {
2365+ 'clock-expire' : 'a' ,
2366+ },
2367+ 'graph' : {
2368+ 'P1Y' : '@wall_clock => a => b => c'
2369+ },
2370+ },
2371+ 'runtime' : {
2372+ 'a' : {
2373+ 'completion' : 'succeeded or expired' ,
2374+ },
2375+ },
2376+ })
2377+ schd = scheduler (id_ , paused_start = False )
2378+ async with run (schd ):
2379+ # each cycle should expire and spawn in turn
2380+ await complete (schd , '2005/a' )
2381+ for cycle in range (2000 , 2006 ):
2382+ assert log_filter (regex = rf'{ cycle } /a:waiting.*expired' )
2383+
2384+ # * the next instance should have been spawned
2385+ # * it should be the only task in the pool
2386+ assert {
2387+ itask .tokens .relative_id for itask in schd .pool .get_tasks ()
2388+ } == {'2006/a' }
2389+
2390+
23452391async def test_downstream_complete_before_upstream (
23462392 flow , scheduler , start , db_select
23472393):
0 commit comments