aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2013-03-22 11:55:17 +0000
committerJon Leighton <j@jonathanleighton.com>2013-03-22 11:55:17 +0000
commit79c02e849b94ee680e824828be4ddf029e05ba12 (patch)
treea313db53033756f03934fa0d22ea8a5ec3871660
parent0d3cb003de66409e8deccddcf8426822a84b3930 (diff)
downloadrails-79c02e849b94ee680e824828be4ddf029e05ba12.tar.gz
rails-79c02e849b94ee680e824828be4ddf029e05ba12.tar.bz2
rails-79c02e849b94ee680e824828be4ddf029e05ba12.zip
Delete failing test
I don't think this is testing anything useful, and the test code is exceedingly brittle. It is broken since 34c7e73c1def1312e59ef1f334586ff2f668246e because the test code makes assumptions about the implementation of PostgreSQLAdapter#active? which are incorrect after the commit. I could fix this test but it would be even more brittle (by stubbing the underlying @connection.connect_poll) and it doesn't test any complex logic. I conclude that it's not worth it.
-rw-r--r--activerecord/test/cases/adapters/postgresql/connection_test.rb36
1 files changed, 0 insertions, 36 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/connection_test.rb b/activerecord/test/cases/adapters/postgresql/connection_test.rb
index c03660957e..6b726ce875 100644
--- a/activerecord/test/cases/adapters/postgresql/connection_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/connection_test.rb
@@ -81,42 +81,6 @@ module ActiveRecord
assert_equal 'SCHEMA', @connection.logged[0][1]
end
- def test_reconnection_after_simulated_disconnection_with_verify
- assert @connection.active?
- original_connection_pid = @connection.query('select pg_backend_pid()')
-
- # Fail with bad connection on next query attempt.
- raw_connection = @connection.raw_connection
- raw_connection_class = class << raw_connection ; self ; end
- raw_connection_class.class_eval <<-CODE, __FILE__, __LINE__ + 1
- def query_fake(*args)
- if !( @called ||= false )
- self.stubs(:status).returns(PGconn::CONNECTION_BAD)
- @called = true
- raise PGError
- else
- self.unstub(:status)
- query_unfake(*args)
- end
- end
-
- alias query_unfake query
- alias query query_fake
- CODE
-
- begin
- @connection.verify!
- new_connection_pid = @connection.query('select pg_backend_pid()')
- ensure
- raw_connection_class.class_eval <<-CODE, __FILE__, __LINE__ + 1
- alias query query_unfake
- undef query_fake
- CODE
- end
-
- assert_not_equal original_connection_pid, new_connection_pid, "Should have a new underlying connection pid"
- end
-
# Must have with_manual_interventions set to true for this
# test to run.
# When prompted, restart the PostgreSQL server with the