Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#4612

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...]

Reported by Santiago Pastorino · May 16th, 2010 @ 06:00 AM

State: resolved
Milestone: 3.0.2
Assigned to: Aaron Patterson Aaron Patterson
Importance: High

Activity

  1. PacoGuzman
    PacoGuzman

    Verified.

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

    May 16th, 2010 @ 03:32 PM

  2. PacoGuzman
    PacoGuzman

    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?

    May 16th, 2010 @ 04:27 PM

  3. PacoGuzman
    PacoGuzman

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

    May 16th, 2010 @ 04:28 PM

  4. Rohit Arondekar
    Rohit Arondekar

    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.

    May 17th, 2010 @ 01:26 AM

  5. Jeremy Kemper
    Jeremy Kemper

    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.

    May 17th, 2010 @ 01:50 AM

  6. PacoGuzman
    PacoGuzman

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

    May 17th, 2010 @ 07:24 AM

  7. Repository
  8. Santiago Pastorino
    Santiago Pastorino

    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'
    

    May 17th, 2010 @ 04:34 PM

  9. Rohit Arondekar
    Rohit Arondekar

    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.

    May 19th, 2010 @ 01:58 AM

  10. PacoGuzman
    PacoGuzman

    Hi Rohit,

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

    May 19th, 2010 @ 07:06 AM

  11. Rohit Arondekar
    Rohit Arondekar

    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.

    May 19th, 2010 @ 08:48 AM

  12. Aaron Patterson
    Aaron Patterson

    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.

    June 8th, 2010 @ 03:26 PM

  13. Repository
  14. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to High

    October 15th, 2010 @ 11:01 PM