Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActiveRecord eager load test failure with certain test order #6465

Closed
pmahoney opened this issue May 23, 2012 · 8 comments
Closed

ActiveRecord eager load test failure with certain test order #6465

pmahoney opened this issue May 23, 2012 · 8 comments

Comments

@pmahoney
Copy link
Contributor

With master c1487f6 I am able to get test failures when running a particular subset of tests. At least two other people (@yahonda @sikachu) have reproduced the same error. The command to run the test subset:

ruby -w -I"lib:test" -e '["test/cases/associations/eager_test.rb", "test/cases/associations/join_model_test.rb", "test/cases/base_test.rb"].each { |f| load f }'

The errors: https://gist.github.com/b63ff56442df508b4300

It seems that the tests assume ActiveRecord has already cached some metadata when it has not done so (SELECT name FROM sqlite_master ...). Is there a way to force loading of this metadata before the test?

@yahonda has a possible fix here: yahonda@d002176

This failure doesn't happen when running the full test suite. But it does happen with the full suite on postgres after applying this patch #6416 (full disclosure: my interests are mostly selfish; I want my pull request accepted :P ).

@rafaelfranca
Copy link
Member

@pmahoney the @yahonda fix seems reasonable. I asked him to do some improvements in the commit. I think that when he finish these improvements you can cherry-pick his commit and open a pull request with your fix and the @yahonda commit.

@yahonda
Copy link
Member

yahonda commented May 23, 2012

I've made some changes to my commit. @pmahoney You can cherry-pick it and open your pull request. @rafaelfranca Thanks for your reviews and suggestions.

@rafaelfranca
Copy link
Member

So guys, any update on this?

@ghost ghost assigned rafaelfranca May 25, 2012
@pmahoney
Copy link
Contributor Author

I am struggling with git here...

I pulled yahonda's patch into my threadsafe-connection-pool branch, and I no longer get those test failures. Since threadsafe-connection-pool was already pushed to github (and merged and then reverted from rails master), I did a "git merge master", and it now seems a mess to do a pull request on that branch.

I'm preparing another branch that has a squashed commit including everything. Is this the right way to go? It may lose info about the source of yahonda's changes for example.

But I'm still getting test failures: https://gist.github.com/2788538 And I get similar failures on both master and my threadsafe-connection-pool branch, so I don't think my patch is causing any of these. On the other hand, I don't see these failures on ci.

@rafaelfranca
Copy link
Member

@pmahoney what you can do about the git is create a new branch using the master as base and cherry-pick both your changes and @yahonda's one.

I think that theses failures was fixed in the master branch.

Ping me if you think that you need help.

@pmahoney
Copy link
Contributor Author

@rafaelfranca Thanks for the advice. I think I've got it: #6488

@yahonda
Copy link
Member

yahonda commented Jun 22, 2012

Please go ahead to close this issue. I believe it has been resolved.

@rafaelfranca
Copy link
Member

Aha! I forgot this. Thanks @yahonda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants