[Rails] Re: maddening intermittent failures in unit tests with

Chris otipher at yahoo.com
Wed Mar 1 16:08:24 GMT 2006


Chris <otipher at ...> writes:

> 
> Hi all,
> 
> This testing problem has been a sink for time today, and is still unresolved.
> 
> Basically I have some unit tests that test simple functions (example below) 
> that depend on join operations in a habtm relationship, and I suspect I am 
> getting "false" failures, i.e ones that do not logically make any sense. I 
> need fresh sets of eyes to take a look and see if I'm mising something (my 
> error, rails bug?, mysql bug?).  
> 

Problem solved, this turned out to be that one unit test - user_test.rb - did 
not include the join table fixtures :users_zimps (though no errors were 
flagged by rails).  

Because the other unit test zimp_test.rb did specify the join table fixture 
loading, it led to random successes and failures for the user_test.rb that did 
not include the fixture loading. 

I added somethig under the gotchas section of the wiki - 
http://wiki.rubyonrails.org/rails/pages/Gotcha  - to help others who may 
encounter this behavior.






More information about the Rails mailing list