Test case with an infinite loop in graph.dfs