S. Brent Faulkner
2008-Aug-14 04:16 UTC
test_include_query(EagerLoadPolyAssocsTest) fails for test_mysql when auto_increment_increment != 1 [PATCH] [#825]
I found a problem in activerecord/test/cases/associations/eager_load_nested_include_test.rb where the test is dependent upon the id values assigned to the test data In my case, my MySQL my.cnf had an auto_increment_increment value of 5, so the created records did not have sequential ids (and so the test failed and rake tests did not all pass) I have submitted a patch on lighthouse that removes the dependency on the id values Hopefully, this can get merged to core soon Cheers. --Brent --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
S. Brent Faulkner
2008-Aug-14 23:23 UTC
Re: test_include_query(EagerLoadPolyAssocsTest) fails for test_mysql when auto_increment_increment != 1 [PATCH] [#825]
Here''s a link to the ticket... http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/825 Anyone else running MySQL with auto_increment_increment set to anything other than 1, please help by (reproducing the problem and) testing the patch please. On Aug 14, 12:16 am, "S. Brent Faulkner" <bre...@unwwwired.net> wrote:> I found a problem in > activerecord/test/cases/associations/eager_load_nested_include_test.rb > where the test is dependent upon the id values assigned to the test > data > > In my case, my MySQL my.cnf had an auto_increment_increment value of > 5, so the created records did not have sequential ids (and so the test > failed and rake tests did not all pass) > > I have submitted a patch on lighthouse that removes the dependency on > the id values > > Hopefully, this can get merged to core soon > > Cheers. > > --Brent--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
S. Brent Faulkner
2008-Aug-16 11:39 UTC
Re: test_include_query(EagerLoadPolyAssocsTest) fails for test_mysql when auto_increment_increment != 1 [PATCH] [#825]
Anyone out there able to test this? Seems kind of important to be able to run the tests successfully without reconfiguring mysql... Help! Please? On Aug 14, 7:23 pm, "S. Brent Faulkner" <bre...@unwwwired.net> wrote:> Here''s a link to the ticket...http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/825 > > Anyone else running MySQL with auto_increment_increment set to > anything other than 1, please help by (reproducing the problem and) > testing the patch please. > > On Aug 14, 12:16 am, "S. Brent Faulkner" <bre...@unwwwired.net> wrote: > > > I found a problem in > > activerecord/test/cases/associations/eager_load_nested_include_test.rb > > where the test is dependent upon the id values assigned to the test > > data > > > In my case, my MySQL my.cnf had an auto_increment_increment value of > > 5, so the created records did not have sequential ids (and so the test > > failed and rake tests did not all pass) > > > I have submitted a patch on lighthouse that removes the dependency on > > the id values > > > Hopefully, this can get merged to core soon > > > Cheers. > > > --Brent--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Koziarski
2008-Aug-17 12:03 UTC
Re: test_include_query(EagerLoadPolyAssocsTest) fails for test_mysql when auto_increment_increment != 1 [PATCH] [#825]
> Anyone out there able to test this? Seems kind of important to be able > to run the tests successfully without reconfiguring mysql... > > Help! Please?Hi there, I think the gist of this fix is great, just a few comments: * You should probably hold the objects, not the ids in the class arrays. * You could use after_saves to do the storing * You could encapsulate the ''get a random one of these'' with Foo.random Other than that it looks good. Tests relying on the ids is a bit of a smell. Out of interest, why do you need to change that setting? -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
S. Brent Faulkner
2008-Aug-17 23:56 UTC
Re: test_include_query(EagerLoadPolyAssocsTest) fails for test_mysql when auto_increment_increment != 1 [PATCH] [#825]
> I think the gist of this fix is great, just a few comments: > > * You should probably hold the objects, not the ids in the class arrays. > * You could use after_saves to do the storing > * You could encapsulate the ''get a random one of these'' with Foo.randomCool. I will look at cleaning that up and attach a new patch to the ticket.> Other than that it looks good. Tests relying on the ids is a bit of a smell.Thanks, and yes, that''s what I thought.> Out of interest, why do you need to change that setting?My development environment matches the production environment for one of my clients. On that system, I''m running a BackgrounDRb task to synchronize the contents of tables in a MySQL database with the contents of a legacy database via ODBC. Since records can be created on both systems we use an increment of 5 paired with a different starting offset (1 on the legacy system and 2 in MySQL) to guarantee unique ids (e.g. ids would be 1, 6, 11... on the legacy system and 2, 7, 12... on MySQL ). Cheers. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
S. Brent Faulkner
2008-Aug-18 00:57 UTC
Re: test_include_query(EagerLoadPolyAssocsTest) fails for test_mysql when auto_increment_increment != 1 [PATCH] [#825]
> * You should probably hold the objects, not the ids in the class arrays. > * You could use after_saves to do the storing > * You could encapsulate the ''get a random one of these'' with Foo.randomDone. Please see the ticket... http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/825 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---