Skip to content

Commit 1d9a526

Browse files
authored
Merge pull request #2927 from vkarak/bugfix/cleanup-fixtures
[bugfix] Properly cleanup resources of dependencies when their dependents are filtered
2 parents fe49f64 + 4964b48 commit 1d9a526

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

reframe/frontend/dependencies.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,14 @@ def prune_deps(graph, testcases, max_depth=None):
205205
if adj not in pruned_graph:
206206
unvisited.append(adj)
207207

208+
# Re-calculate the in-degree of the pruned graph nodes
209+
for u in pruned_graph:
210+
u.in_degree = 0
211+
212+
for u, adjacent in pruned_graph.items():
213+
for v in adjacent:
214+
v.in_degree += 1
215+
208216
return pruned_graph
209217

210218

unittests/test_dependencies.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,14 @@ def test_prune_deps(default_exec_ctx):
697697
assert len(pruned_deps[node('t5')]) == 0
698698
assert len(pruned_deps[node('t0')]) == 0
699699

700+
# Check the degree of the nodes of the pruned graph
701+
assert in_degree(pruned_deps, node('t0')) == 1
702+
assert in_degree(pruned_deps, node('t1')) == 2
703+
assert in_degree(pruned_deps, node('t2')) == 1
704+
assert in_degree(pruned_deps, node('t3')) == 0
705+
assert in_degree(pruned_deps, node('t5')) == 1
706+
assert in_degree(pruned_deps, node('t7')) == 0
707+
700708

701709
def test_toposort(default_exec_ctx):
702710
#

0 commit comments

Comments
 (0)