Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Mar 22, 2013
@jonleighton jonleighton Delete failing test
I don't think this is testing anything useful, and the test code is
exceedingly brittle. It is broken since
34c7e73 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.
79c02e8
@jonleighton jonleighton Send SIGTERM, not SIGQUIT.
SIGTERM is the correct signal for a graceful exit.

This will hopefully resolve #9761.
7748d64
View
36 activerecord/test/cases/adapters/postgresql/connection_test.rb
@@ -81,42 +81,6 @@ def test_schema_names_logs_name
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
View
2 railties/test/application/console_test.rb
@@ -127,7 +127,7 @@ def write_prompt(command, expected_output = nil)
end
def kill(pid)
- Process.kill('QUIT', pid)
+ Process.kill('TERM', pid)
Process.wait(pid)
rescue Errno::ESRCH
end

No commit comments for this range

Something went wrong with that request. Please try again.