Skip to content

Commit

Permalink
Await a established connection to ensure the received errors match ex…
Browse files Browse the repository at this point in the history
…actly.

This test failed on Windows x64.
  • Loading branch information
larskanis committed Jul 18, 2013
1 parent 09bdc16 commit 4c5704a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spec/pg/connection_spec.rb
Expand Up @@ -598,6 +598,9 @@
it "block should raise ConnectionBad for a closed connection" do
serv = TCPServer.new( '127.0.0.1', 54320 )
conn = described_class.connect_start( '127.0.0.1', 54320, "", "", "me", "xxxx", "somedb" )
while [PG::CONNECTION_STARTED, PG::CONNECTION_MADE].include?(conn.connect_poll)
sleep 0.1
end
serv.close
expect{ conn.block }.to raise_error(PG::ConnectionBad, /server closed the connection unexpectedly/)
expect{ conn.block }.to raise_error(PG::ConnectionBad, /can't get socket descriptor/)
Expand Down

0 comments on commit 4c5704a

Please sign in to comment.