This project is archived and is in readonly mode.

#4612 ✓resolved
Santiago Pastorino

Thousands of errors on AR with ruby-sqlite3 and ruby 1.9.2

Reported by Santiago Pastorino | May 16th, 2010 @ 06:00 AM | in 3.0.2

To show some of them ...

1041) Error:
test_only_call_after_rollback_on_records_rolled_back_to_a_savepoint(TransactionCallbacksTest):
ArgumentError: assertion message must be String or Proc, but Fixnum was given.
    test/cases/transaction_callbacks_test.rb:199:in `test_only_call_after_rollback_on_records_rolled_back_to_a_savepoint'
    /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/mocha-0.9.8/lib/mocha/integration/mini_test/version_131_and_above.rb:26:in `run'
    /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:35:in `block in run'
    /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/callbacks.rb:413:in `_run_setup_callbacks'
    /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:34:in `run'

1042) Error:
test_only_call_after_rollback_on_records_rolled_back_to_a_savepoint_when_release_savepoint_fails(TransactionCallbacksTest):
ArgumentError: assertion message must be String or Proc, but Fixnum was given.
    test/cases/transaction_callbacks_test.rb:224:in `test_only_call_after_rollback_on_records_rolled_back_to_a_savepoint_when_release_savepoint_fails'
    /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/mocha-0.9.8/lib/mocha/integration/mini_test/version_131_and_above.rb:26:in `run'
    /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:35:in `block in run'
    /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/callbacks.rb:413:in `_run_setup_callbacks'
    /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:34:in `run'

1043) Error:
test_only_call_after_rollback_on_update_after_transaction_rollsback_for_existing_record(TransactionCallbacksTest):
ArgumentError: assertion message must be String or Proc, but Array was given.
    test/cases/transaction_callbacks_test.rb:125:in `test_only_call_after_rollback_on_update_after_transaction_rollsback_for_existing_record'
    /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/mocha-0.9.8/lib/mocha/integration/mini_test/version_131_and_above.rb:26:in `run'
    /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:35:in `block in run'
    /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/callbacks.rb:413:in `_run_setup_callbacks'
    /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:34:in `run'

2175 tests, 3968 assertions, 0 failures, 1043 errors, 0 skips

Test run options: --seed 49357
rake aborted!
Command failed with status (1): [/home/santiago/.rvm/rubies/ruby-1.9.2-head...]

Comments and changes to this ticket

  • PacoGuzman

    PacoGuzman May 16th, 2010 @ 03:32 PM

    Verified.

    In a clean installation of ruby-1.9.2-head with rvm in rails edge

  • PacoGuzman

    PacoGuzman May 16th, 2010 @ 04:27 PM

    I've found some not correct uses of assert and I changed them to assert_select. But this break the tests, I think this test not broken well before

    I've attached the tests rewrite

    I don't know how to proceed with this, any suggestions?

  • PacoGuzman

    PacoGuzman May 16th, 2010 @ 04:28 PM

    Excuse me. What I wanted to say is that those tests not worked well before

  • Rohit Arondekar

    Rohit Arondekar May 17th, 2010 @ 01:26 AM

    Verified

    I think we need a way to break up those tests (maybe filewise?) so that individuals can work on them without tripping each other.

  • Jeremy Kemper

    Jeremy Kemper May 17th, 2010 @ 01:50 AM

    Paco, thanks for the test fixes (even if they now fail!)

    Please upload a diff using git format-patch so we can credit you as patch author.

  • PacoGuzman

    PacoGuzman May 17th, 2010 @ 07:24 AM

    Jeremy, I've attached a new patch using git format-patch

  • Repository

    Repository May 17th, 2010 @ 03:58 PM

    (from [c2fb8afaa0e6a8f3d1782c97790a4bea8d4f0b0b]) Use assert_equal correctly in transaction callback tests (exposing some of them as broken)

    [#4612]

    Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
    http://github.com/rails/rails/commit/c2fb8afaa0e6a8f3d1782c97790a4b...

  • Santiago Pastorino

    Santiago Pastorino May 17th, 2010 @ 04:34 PM

    Sorry guys, i didn't realize that i paste the wrong part of the output ... here are two of the hard failures ...

    1034) Error:
    test_sane_find_with_scoped_lock(PessimisticLockingTest):
    SQLite3::SQLException: cannot rollback - no transaction is active
        /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:89:in `close'
        /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:89:in `ensure in prepare'
        /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:89:in `prepare'
        /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:125:in `execute'
        /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:512:in `rollback'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:183:in `block in rollback_db_transaction'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:390:in `catch_schema_changes'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:183:in `rollback_db_transaction'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:176:in `rescue in transaction'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:162:in `transaction'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:512:in `block (2 levels) in create_fixtures'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:109:in `disable_referential_integrity'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:503:in `block in create_fixtures'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/benchmarkable.rb:55:in `silence'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:502:in `create_fixtures'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:964:in `load_fixtures'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:939:in `setup_fixtures'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/callbacks.rb:409:in `_run_setup_callbacks'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:34:in `run'
    
    1035) Error:
    test_sane_lock_method(PessimisticLockingTest):
    SQLite3::SQLException: cannot rollback - no transaction is active
        /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:89:in `close'
        /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:89:in `ensure in prepare'
        /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:89:in `prepare'
        /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:125:in `execute'
        /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:512:in `rollback'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:183:in `block in rollback_db_transaction'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:390:in `catch_schema_changes'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:183:in `rollback_db_transaction'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:176:in `rescue in transaction'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:162:in `transaction'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:512:in `block (2 levels) in create_fixtures'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:109:in `disable_referential_integrity'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:503:in `block in create_fixtures'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/benchmarkable.rb:55:in `silence'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:502:in `create_fixtures'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:964:in `load_fixtures'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:939:in `setup_fixtures'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/callbacks.rb:409:in `_run_setup_callbacks'
        /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:34:in `run'
    
  • Rohit Arondekar

    Rohit Arondekar May 19th, 2010 @ 01:58 AM

    Note that Rails is using sqlite3-ruby-1.3.0.beta.2 I think it's beta.2 that's causing problems because that cannot rollback error is pretty common.

  • PacoGuzman

    PacoGuzman May 19th, 2010 @ 07:06 AM

    Hi Rohit,

    Santiago Pastorino detected this error when Rails edge were using sqlite3-ruby-1.3.0.beta.1

  • Rohit Arondekar

    Rohit Arondekar May 19th, 2010 @ 08:48 AM

    PacoGuzman, Santiago is it possible that the beta version of sqlite3 is causing this problem? Maybe something to do with transactions or rollbacks has changed.

  • Aaron Patterson

    Aaron Patterson June 8th, 2010 @ 03:26 PM

    I've attached a patch that fixes it. The problem is that rails stores "binary" columns in sqlite3 as UTF-8 columns. It needs to force encoding the binary columns back to ascii-8bit before returning them.

  • Repository

    Repository June 8th, 2010 @ 07:33 PM

    • State changed from “open” to “resolved”

    (from [eb69721c9bf2bd0f8957a231ecc91080b0645b84]) forcing encoding on 1.9 when dealing with "binary" columns [#4612 state:resolved]

    Signed-off-by: wycats wycats@gmail.com
    http://github.com/rails/rails/commit/eb69721c9bf2bd0f8957a231ecc910...

  • Jeremy Kemper

    Jeremy Kemper October 15th, 2010 @ 11:01 PM

    • Milestone set to 3.0.2
    • Importance changed from “” to “High”
  • csnk

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages