Skip to content

Commit 14e5cf2

Browse files
committed
only assert socket timeout if config[:connect_timeout] is set
1 parent 7eaa4f0 commit 14e5cf2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/db/postgresql/simple_test.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ def test_extensions
194194
jdbc_connection.protoConnection.class.class_eval { field_reader :pgStream }
195195

196196
timeout = jdbc_connection.protoConnection.pgStream.getSocket.getSoTimeout
197-
assert_equal 10 * 1000, timeout
197+
if connect_timeout = current_connection_config[:connect_timeout]
198+
assert_equal connect_timeout.to_i * 1000, timeout
199+
end
198200
end if defined? JRUBY_VERSION
199201

200202

0 commit comments

Comments
 (0)