No bug: [taskgraph] Improve the error message in Graph.transitive_closure; r=mhentges
authorTom Prince <mozilla@hocat.ca>
Thu, 03 Oct 2019 01:27:02 +0000
changeset 496215 dc0872f50a4424faf1a92f967e77ab2e7f2c8e39
parent 496214 b2053e82f1596004c7ac9aba1484e42cb1c88063
child 496216 d5fdd5665fed837e302e4f86ccbcccfe79ff86a0
push id36647
push usernerli@mozilla.com
push dateFri, 04 Oct 2019 04:09:18 +0000
treeherdermozilla-central@678d4d2c3c4d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhentges
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
No bug: [taskgraph] Improve the error message in Graph.transitive_closure; r=mhentges Differential Revision: https://phabricator.services.mozilla.com/D48000
taskcluster/taskgraph/graph.py
--- a/taskcluster/taskgraph/graph.py
+++ b/taskcluster/taskgraph/graph.py
@@ -45,17 +45,18 @@ class Graph(object):
                   `-------> d
 
         transitive_closure([b]).nodes == set([a, b])
         transitive_closure([c]).nodes == set([c, b, a])
         transitive_closure([c], reverse=True).nodes == set([c])
         transitive_closure([b], reverse=True).nodes == set([b, c, d])
         """
         assert isinstance(nodes, set)
-        assert nodes <= self.nodes
+        if not (nodes <= self.nodes):
+            raise Exception("Unknown nodes in transitive closure: {}".format(nodes - self.nodes))
 
         # generate a new graph by expanding along edges until reaching a fixed
         # point
         new_nodes, new_edges = nodes, set()
         nodes, edges = set(), set()
         while (new_nodes, new_edges) != (nodes, edges):
             nodes, edges = new_nodes, new_edges
             add_edges = set((left, right, name)