|
14 | 14 | # You should have received a copy of the GNU General Public License
|
15 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16 | 16 |
|
| 17 | + |
17 | 18 | from cylc.flow.config import WorkflowConfig
|
18 | 19 | from cylc.flow.pathutil import get_workflow_run_dir
|
19 | 20 | from cylc.flow.scheduler_cli import RunOptions
|
20 | 21 | from cylc.flow.task_outputs import TASK_OUTPUT_SUCCEEDED
|
21 | 22 | from cylc.flow.workflow_files import WorkflowFiles
|
22 | 23 |
|
23 | 24 |
|
| 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 | + |
24 | 54 | def test_graph_children(flow):
|
25 | 55 | """TaskDef.graph_children should not include duplicates.
|
26 | 56 |
|
|
0 commit comments