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

1.0.9 breaks my tests... fixed it by adding gem "after_commit", "1.0.8" #5

Closed
bwlang opened this issue Jun 15, 2011 · 10 comments
Closed

Comments

@bwlang
Copy link

bwlang commented Jun 15, 2011

I recently did a gem update... and 1.0.9 installed itself

Then all my tests broke with reuse of transaction messages and failure to reset Sham.

I'm using test::unit with transactional fixtures and Machinist (in case that matters)

i've fixed the version at 1.0.8 in my Gemfile and I'm back in action.

This could be related to the change in dependency ... my Gemfile.lock says activerecord < 3.0.0 with 1.0.8, but < 3.0.0, >=1.15.6 with 1.0.9.

so... to fix my test breakage i added this line to Gemfile
gem "after_commit", "1.0.8"

before this trouble, after_commit was only added as a dependency and was not explicitly listed.

@reist
Copy link

reist commented Jun 15, 2011

I have exactly the same issue with 1.0.9. All my tests break when switching to it.

For what's it worth, I'm using Ruby 1.8.7, Rails 2.3.5 and minitest with transactional fixtures.

@pat
Copy link
Owner

pat commented Jun 16, 2011

Quick question: are you using MySQL? Or PostgreSQL?

@nirvdrum
Copy link

I don't, but I'd be happy to try it out. Unfortunately my schema won't load in MySQL since I'm using some Postgres-specific extensions. Do you know of any simple projects I might be able to fork to try it out?

@bwlang
Copy link
Author

bwlang commented Jun 16, 2011

On Wed, Jun 15, 2011 at 10:12 PM, freelancing-god
reply@reply.github.com
wrote:

Quick question: are you using MySQL? Or PostgreSQL?

I'm using postgresql.

@nirvdrum
Copy link

@bwlang To test out the Gemfile.lock version theory, would you mind manually changing the lock file? You should be able to remove the >= 1.15.6 without any issues.

@nirvdrum
Copy link

I should note that I have noticed now that when there is a test failure someplace, I do now see messages about reusing transactions. I thought this was related to some other dependency update I did, but I'll look more into after_commit now.

@graaff
Copy link

graaff commented Jun 19, 2011

I'm seeing the transaction reuse problems when running after_commit's test suite with activerecord 2.3.12 and sqlite-1.3.3:

  1) Error:
test_after_commit_does_not_trigger_when_unrelated_transaction_commits(AfterCommitTest):
SQLite3::SQLException: cannot start a transaction within a transaction
    /usr/lib64/ruby/gems/1.8/gems/sqlite3-1.3.3/lib/sqlite3/database.rb:97:in `close'
    /usr/lib64/ruby/gems/1.8/gems/sqlite3-1.3.3/lib/sqlite3/database.rb:97:in `prepare'
    /usr/lib64/ruby/gems/1.8/gems/sqlite3-1.3.3/lib/sqlite3/database.rb:134:in `execute'
    /usr/lib64/ruby/gems/1.8/gems/sqlite3-1.3.3/lib/sqlite3/database.rb:484:in `transaction'
    /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/sqlite_adapter.rb:196:in `begin_db_transaction'
    /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/sqlite_adapter.rb:418:in `catch_schema_changes'
    /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/sqlite_adapter.rb:196:in `begin_db_transaction'
    /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/database_statements.rb:129:in `transaction'
    /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:182:in `transaction'
    /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:200:in `save!'
    /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
    /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:200:in `save!'
    /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/validations.rb:1071:in `create!'
    ./test/after_commit_test.rb:188:in `test_after_commit_does_not_trigger_when_unrelated_transaction_commits'

(and 24 more similar to this).

@pat
Copy link
Owner

pat commented Jun 23, 2011

Okay, just released 1.0.10, should fix these problems.

@pat pat closed this as completed Jun 23, 2011
@graaff
Copy link

graaff commented Jun 23, 2011

1.0.10 passes the test suite for me. Thanks!

@reist
Copy link

reist commented Jun 25, 2011

10.10 passes the test suite for me on mysql with ruby 1.8.7 and 1.9.2 both.
Thanks you!

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

No branches or pull requests

5 participants