From 124ff3c17c6c6b1ac1b1b6af21e269d5b4f9f222 Mon Sep 17 00:00:00 2001 From: Matt Robinson Date: Thu, 3 Mar 2011 18:28:35 -0800 Subject: maint: Fix a randomization test failure The commit for #2597 included a test that asserted the text resulting from detecting a cycle. However, the cycle detection could start randomly from any node, resulting in different text in the error. I'm not sure what the randomization key would be based on since the test failed consistently over dozens of runs for me, and didn't for Daniel. Paired-with: Daniel Pittman --- spec/unit/simple_graph_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/unit/simple_graph_spec.rb b/spec/unit/simple_graph_spec.rb index 2c6af063b..c106f550b 100755 --- a/spec/unit/simple_graph_spec.rb +++ b/spec/unit/simple_graph_spec.rb @@ -305,7 +305,9 @@ describe Puppet::SimpleGraph do it "should produce the correct relationship text" do add_edges :a => :b, :b => :a - want = %r{Found 1 dependency cycle:\n\(a => b => a\)\nTry} + # cycle detection starts from a or b randomly + # so we need to check for either ordering in the error message + want = %r{Found 1 dependency cycle:\n\((a => b => a|b => a => b)\)\nTry} expect { @graph.topsort }.to raise_error(Puppet::Error, want) end -- cgit