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 <[email protected]> Signed-off-by: Matt Robinson <[email protected]> --- Local-branch: ticket/next/maint-fix_test_randomization_problem spec/unit/simple_graph_spec.rb | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/spec/unit/simple_graph_spec.rb b/spec/unit/simple_graph_spec.rb index 2c6af06..c106f55 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 -- 1.7.3.1 -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
