Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/f: fix flaky test api-workflow-info #4361

Merged
merged 2 commits into from
Aug 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cylc/flow/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ def __init__(
else:
if foot not in self.feet:
self.feet.append(foot)
self.feet.sort() # sort effects get_graph_raw output

# Replace workflow and task name in workflow and task URLs.
self.cfg['meta']['URL'] = self.cfg['meta']['URL'] % {
Expand Down Expand Up @@ -1434,8 +1435,12 @@ def _check_explicit_cycling(self):
taskdef.check_for_explicit_cycling()

def get_task_name_list(self):
# return a list of all tasks used in the dependency graph
return list(self.taskdefs)
"""Return a sorted list of all tasks used in the dependency graph.

Note: the sort order may effect get_graph_raw ouput.

"""
return sorted(self.taskdefs)

def generate_edges(self, lexpr, orig_lexpr, left_nodes, right, seq,
suicide=False):
Expand Down
3 changes: 2 additions & 1 deletion cylc/flow/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,8 @@ def info_get_graph_raw(self, cto, ctn, grouping=None):
self.config.get_graph_raw(cto, ctn, grouping),
self.config.workflow_polling_tasks,
self.config.leaves,
self.config.feet)
self.config.feet
)

def command_stop(
self,
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/api-workflow-info/00-get-graph-raw-1.t
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ cmp_ok "${WORKFLOW_RUN_DIR}/ctb-get-graph-raw.out" <<'__OUT__'
"t3"
],
[
"t1",
"T"
"T",
"t1"
]
]
__OUT__
Expand Down
16 changes: 12 additions & 4 deletions tests/functional/api-workflow-info/00-get-graph-raw-1/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@
[runtime]
[[t1]]
script = """
python3 ${CYLC_WORKFLOW_RUN_DIR}/bin/ctb-get-graph-raw \
'start_point_str=1' 'stop_point_str=1' 'grouping=<all>' \
>"${CYLC_WORKFLOW_RUN_DIR}/ctb-get-graph-raw.out"
"""
cylc client \
"$CYLC_WORKFLOW_NAME" \
get_graph_raw \
>"${CYLC_WORKFLOW_RUN_DIR}/ctb-get-graph-raw.out" \
<<__HERE__
{
"start_point_str": "1",
"stop_point_str": "1",
"grouping": ["<all>"]
}
__HERE__
"""
[[T]]
script = true
[[t2, t3]]
Expand Down
20 changes: 14 additions & 6 deletions tests/functional/api-workflow-info/01-get-graph-raw-2/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@
[runtime]
[[t1]]
script = """
if [[ "${CYLC_TASK_CYCLE_POINT}" == '2020' ]]; then
python3 ${CYLC_WORKFLOW_RUN_DIR}/bin/ctb-get-graph-raw \
'start_point_str=2020' 'stop_point_str=2021' 'grouping=<all>' \
>"${CYLC_WORKFLOW_RUN_DIR}/ctb-get-graph-raw.out"
fi
"""
if [[ "${CYLC_TASK_CYCLE_POINT}" == '2020' ]]; then
cylc client \
"$CYLC_WORKFLOW_NAME" \
get_graph_raw \
>"${CYLC_WORKFLOW_RUN_DIR}/ctb-get-graph-raw.out" \
<<__HERE__
{
"start_point_str": "2020",
"stop_point_str": "2021",
"grouping": ["<all>"]
}
__HERE__
fi
"""
20 changes: 14 additions & 6 deletions tests/functional/api-workflow-info/02-get-graph-raw-3/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@
[runtime]
[[t1]]
script = """
if [[ "${CYLC_TASK_CYCLE_POINT}" == '2020' ]]; then
python3 ${CYLC_WORKFLOW_RUN_DIR}/bin/ctb-get-graph-raw \
'start_point_str=2020' 'stop_point_str=2021' 'grouping=<all>' \
>"${CYLC_WORKFLOW_RUN_DIR}/ctb-get-graph-raw.out"
fi
"""
if [[ "${CYLC_TASK_CYCLE_POINT}" == '2020' ]]; then
cylc client \
"$CYLC_WORKFLOW_NAME" \
get_graph_raw \
>"${CYLC_WORKFLOW_RUN_DIR}/ctb-get-graph-raw.out" \
<<__HERE__
{
"start_point_str": "2020",
"stop_point_str": "2021",
"grouping": ["<all>"]
}
__HERE__
fi
"""
22 changes: 14 additions & 8 deletions tests/functional/api-workflow-info/03-get-graph-raw-4/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@
[runtime]
[[t1]]
script = """
if [[ "${CYLC_TASK_CYCLE_POINT}" == '20200202T0000Z' ]]; then
python3 ${CYLC_WORKFLOW_RUN_DIR}/bin/ctb-get-graph-raw \
'start_point_str=20200202T0000Z' \
'stop_point_str=20200203T0000Z' \
'grouping=<all>' \
>"${CYLC_WORKFLOW_RUN_DIR}/ctb-get-graph-raw.out"
fi
"""
if [[ "${CYLC_TASK_CYCLE_POINT}" == '20200202T0000Z' ]]; then
cylc client \
"$CYLC_WORKFLOW_NAME" \
get_graph_raw \
>"${CYLC_WORKFLOW_RUN_DIR}/ctb-get-graph-raw.out" \
<<__HERE__
{
"start_point_str": "20200202T0000Z",
"stop_point_str": "20200203T0000Z",
"grouping": ["<all>"]
}
__HERE__
fi
"""
40 changes: 0 additions & 40 deletions tests/functional/api-workflow-info/bin/ctb-get-graph-raw

This file was deleted.