From f6a7d29e21aa0f8e8752296cbe9ec40c7909eb33 Mon Sep 17 00:00:00 2001 From: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:25:51 +0000 Subject: [PATCH] Add test for suicide prereqs --- tests/integration/test_remove.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/integration/test_remove.py b/tests/integration/test_remove.py index 0b38ff945b..0469bddf05 100644 --- a/tests/integration/test_remove.py +++ b/tests/integration/test_remove.py @@ -340,3 +340,34 @@ async def test_prereqs( ('1/a2', None), ('1/b', None), } + + +async def test_suicide(flow, scheduler, run, reflog, complete): + """Test that suicide prereqs are unset by `cylc remove`.""" + schd: Scheduler = scheduler( + flow({ + 'scheduling': { + 'graph': { + 'R1': ''' + a => b => c => d => x + a & c => !x + ''' + }, + }, + }), + paused_start=False, + ) + async with run(schd): + reflog_triggers: set = reflog(schd) + await complete(schd, '1/b') + await run_cmd(remove_tasks(schd, ['1/a'], [FLOW_ALL])) + await complete(schd) + + assert reflog_triggers == { + ('1/a', None), + ('1/b', ('1/a',)), + ('1/c', ('1/b',)), + ('1/d', ('1/c',)), + # 1/x not suicided as 1/a was removed: + ('1/x', ('1/d',)), + }