Skip to content

Commit

Permalink
Add spec for disconnect_connection being called more than once
Browse files Browse the repository at this point in the history
Some parts of Sequel may call disconnect_connection on an
already disconnected connection, so that's something that
should work.

I've seen freezes in do/postgres after checking connections
for validity, so just skip those specs on do/postgres.
  • Loading branch information
jeremyevans committed Oct 24, 2012
1 parent 9a4201b commit 029254e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion spec/integration/database_test.rb
Expand Up @@ -36,7 +36,14 @@
proc{INTEGRATION_DB.pool.hold{raise Interrupt, "test"}}.should raise_error(Interrupt)
end

specify "should provide ability to check connections for validity" do
specify "should be able to disconnect connections more than once without exceptions" do
conn = INTEGRATION_DB.synchronize{|c| c}
INTEGRATION_DB.disconnect
INTEGRATION_DB.disconnect_connection(conn)
INTEGRATION_DB.disconnect_connection(conn)
end

cspecify "should provide ability to check connections for validity", [:do, :postgres] do
conn = INTEGRATION_DB.synchronize{|c| c}
INTEGRATION_DB.valid_connection?(conn).should be_true
INTEGRATION_DB.disconnect
Expand Down

0 comments on commit 029254e

Please sign in to comment.