Skip to content

Commit 26f2ac0

Browse files
authored
Merge pull request #6723 from cylc/8.4.x-sync
🤖 Merge 8.4.x-sync into master
2 parents 0d93fb1 + d0a1060 commit 26f2ac0

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

changes.d/6602.fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a bug where suicide triggers could prevent initial cycle point tasks spawning.

cylc/flow/taskdef.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,10 @@ def generate_graph_parents(
9999
) -> Dict['SequenceBase', List[TaskTuple]]:
100100
"""Determine concrete graph parents of task tdef at point.
101101
102-
Infer parents be reversing upstream triggers that lead to point/task.
102+
Infer parents by reversing upstream triggers that lead to point/task.
103103
"""
104104
graph_parents: Dict['SequenceBase', List[TaskTuple]] = {}
105+
105106
for seq, triggers in tdef.graph_parents.items():
106107
if not seq.is_valid(point):
107108
# Don't infer parents if the trigger belongs to a sequence that
@@ -353,8 +354,8 @@ def has_only_abs_triggers(self, point):
353354
if (
354355
trig.offset_is_absolute or
355356
trig.offset_is_from_icp or
356-
# Don't count self-suicide as a normal trigger.
357-
dep.suicide and trig.task_name == self.name
357+
# Don't count suicide as a normal trigger:
358+
dep.suicide
358359
):
359360
has_abs = True
360361
else:

tests/integration/test_taskdef.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,43 @@
1414
# You should have received a copy of the GNU General Public License
1515
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17+
1718
from cylc.flow.config import WorkflowConfig
1819
from cylc.flow.pathutil import get_workflow_run_dir
1920
from cylc.flow.scheduler_cli import RunOptions
2021
from cylc.flow.task_outputs import TASK_OUTPUT_SUCCEEDED
2122
from cylc.flow.workflow_files import WorkflowFiles
2223

2324

25+
async def test_almost_self_suicide(flow, scheduler, start):
26+
"""Suicide triggers should not count as upstream tasks when looking
27+
to spawn parentless tasks.
28+
29+
https://github.com/cylc/cylc-flow/issues/6594
30+
31+
For the example under test, pre-requisites for ``!a`` should not be
32+
considered the same as pre-requisites for ``a``. If the are then then
33+
is parentless return false for all cases of ``a`` not in the inital cycle
34+
and subsequent cycles never run.
35+
"""
36+
wid = flow({
37+
'scheduler': {'cycle point format': '%Y'},
38+
'scheduling': {
39+
'initial cycle point': 1990,
40+
'final cycle point': 1992,
41+
'graph': {
42+
'R1': 'install_cold',
43+
'P1Y': 'install_cold[^] => a? => b?\nb:fail? => !a?'
44+
}
45+
}
46+
})
47+
schd = scheduler(wid)
48+
async with start(schd):
49+
tasks = [str(t) for t in schd.pool.get_tasks()]
50+
for task in ['1990/a:waiting', '1991/a:waiting', '1992/a:waiting']:
51+
assert task in tasks
52+
53+
2454
def test_graph_children(flow):
2555
"""TaskDef.graph_children should not include duplicates.
2656

0 commit comments

Comments
 (0)