diff --git a/dag/dag.go b/dag/dag.go index 0148ee07ca13..28981358f785 100644 --- a/dag/dag.go +++ b/dag/dag.go @@ -206,6 +206,7 @@ func (g *AcyclicGraph) Walk(cb WalkFunc) error { defer errLock.Unlock() for _, dep := range deps { if errMap[dep] { + errMap[v] = true readyCh <- false return } diff --git a/dag/dag_test.go b/dag/dag_test.go index e7b2db8d2264..93441775a946 100644 --- a/dag/dag_test.go +++ b/dag/dag_test.go @@ -226,8 +226,10 @@ func TestAcyclicGraphWalk_error(t *testing.T) { g.Add(1) g.Add(2) g.Add(3) + g.Add(4) + g.Connect(BasicEdge(4, 3)) g.Connect(BasicEdge(3, 2)) - g.Connect(BasicEdge(3, 1)) + g.Connect(BasicEdge(2, 1)) var visits []Vertex var lock sync.Mutex