MrDys / blacklight

Blacklight Plugin
http://projectblacklight.org/
Other
1 stars 1 forks source link

non-deterministic specs #496

Closed MrDys closed 12 years ago

MrDys commented 12 years ago

CODEBASE-311: At least in my environment, I have some specs that pass/fail non-deterministically. They might fail, and then immediately re-running the specs, they might then pass, with absolutely no code/environment changes.

I don't know if this indicates a bug in our actual code (actual app performing non-predictably), or instead a bug in our spec setup (spec setup being done in some way that's non-deterministic).

Assigning to cbeer cause I seem to recall he dealt with something like this recently, but I may be mis-remembering and don't know for sure if he has time/interest.

Here are some such specs I have identified:

1) BlacklightHelper render_link_rel_alternates generates tags Failure/Error: matches.length.should == 1 expected: 1 got: 3 (using ==)

./blacklight/test_support/spec/helpers/blacklight_helper_spec.rb:448

 # ./blacklight/test_support/spec/helpers/blacklight_helper_spec.rb:447
 # ./blacklight/test_support/spec/helpers/blacklight_helper_spec.rb:446:in `each_pair'
 # ./blacklight/test_support/spec/helpers/blacklight_helper_spec.rb:446

1) BlacklightHelper link_to_document should accept and return a Proc Failure/Error: link_to_document(@document, { :label => Proc.new { |doc, opts| doc.get(:id) + ": " + doc.get(:title_display) } }).should have_selector("a", :content => '123456: 654321', :count => 1) expected following output to contain a 123456: 654321 tag: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">

123456: 654321
 # ./blacklight/test_support/spec/helpers/blacklight_helper_spec.rb:316

2) BlacklightHelper link_to_document should return id when label is missing Failure/Error: link_to_document(@document, { :label => :title_display }).should have_selector("a", :content => '123456', :count => 1) expected following output to contain a 123456 tag: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">

123456
 # ./blacklight/test_support/spec/helpers/blacklight_helper_spec.rb:321
MrDys commented 12 years ago

Original reporter: jrochkind

MrDys commented 12 years ago

jrochkind: doesn't seem to effect anyone else, will close for now.