This project is archived and is in readonly mode.
Fix AR tests for pg on master
Reported by Cezary Baginski | May 1st, 2010 @ 06:20 PM | in 3.0.2
I get errors (pg 0.9.0, Ruby 1.8.7) while running AR tests:
rake test_postgresql TEST=test/cases/transactions_test.rb
1) Failure:
test_open_transactions_count_is_reset_to_zero_if_no_transaction_active(ConcurrentTransactionTest)
[./test/cases/transactions_test.rb:374:in `test_open_transactions_count_is_reset_to_zero_if_no_transaction_active'
(snip)
<0> expected but was
<1>.
Comments and changes to this ticket
-
Cezary Baginski May 1st, 2010 @ 06:24 PM
Patch for just the transaction tests:
-
PGconn::PQTRANS_IDLE symbol was not available during loading the adaptor, so the outside_transaction? method was not overloaded.
-
Removed the symbol, since it probably was unavailable only in ruby-postgres, which is unsupported anyway
-
-
Repository May 1st, 2010 @ 09:40 PM
(from [8b1b273c21a2f1a6eeccca5fbe0303679c2d707d]) AR: fixed postgres transaction tests [#4519 state:commited]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/8b1b273c21a2f1a6eeccca5fbe0303... -
Cezary Baginski May 1st, 2010 @ 10:42 PM
Hopefully last fix, this time fixture tests:
rake test_postgresql TEST=test/cases/fixtures_test.rb
1) Error: test_automatically_sets_primary_key(FoxyFixturesTest): ActiveRecord::RecordNotFound: Couldn't find Ship with ID=751016583 (snip) 74 tests, 349 assertions, 0 failures, 16 errors
The patch:
- ships are inserted, but the transaction is rollbacked because connection.reset_pk_sequence! silently fails (because AR is silenced), because it is given the table name :"admin/account" instead of :"admin_account"
- I tried refactoring the self.create_fixtures method, but gave up, because breaking something else is too easy
- damn it took me a long time to figure out :)
- already rebased against master with the previous patch
- all postgres tests now seem to work
-
Cezary Baginski May 1st, 2010 @ 11:16 PM
#1748 - seems related to first problem and can probably be marked as resolved (2-3 works because transaction handling was over-simplified compared to now).
-
Repository May 2nd, 2010 @ 02:54 AM
- State changed from new to resolved
(from [256a15c23581865559cc758c2e377cd395cc05b3]) AR: fixed postgres fixture tests [#4519 state:resolved]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/256a15c23581865559cc758c2e377c... -
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to Low
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>
People watching this ticket
Attachments
Tags
Referenced by
- 4519 Fix AR tests for pg on master (from [8b1b273c21a2f1a6eeccca5fbe0303679c2d707d]) AR: fix...
- 4519 Fix AR tests for pg on master (from [256a15c23581865559cc758c2e377cd395cc05b3]) AR: fix...