Skip to content

Commit

Permalink
Errno::ETIMEDOUT => Trilogy::TimeoutError in client tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianna-chang-shopify committed Jan 13, 2023
1 parent 31da862 commit fa2f945
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions contrib/ruby/test/client_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ def test_trilogy_connect_tcp_fixnum_port
end

def test_trilogy_connect_tcp_to_wrong_port
e = assert_raises Errno::ECONNREFUSED do
e = assert_raises Trilogy::BaseConnectionError do
new_tcp_client port: 13307
end
assert_equal "Connection refused - trilogy_connect - unable to connect to #{DEFAULT_HOST}:13307", e.message
assert_equal "trilogy_connect - unable to connect to #{DEFAULT_HOST}:13307", e.message
end

def test_trilogy_connect_unix_socket
Expand Down Expand Up @@ -369,7 +369,7 @@ def test_trilogy_closed?
def test_read_timeout
client = new_tcp_client(read_timeout: 0.1)

assert_raises Errno::ETIMEDOUT do
err = assert_raises Trilogy::TimeoutError do
client.query("SELECT SLEEP(1)")
end
ensure
Expand All @@ -381,7 +381,7 @@ def test_adjustable_read_timeout
assert client.query("SELECT SLEEP(0.2)");
client.read_timeout = 0.1
assert_equal 0.1, client.read_timeout
assert_raises Errno::ETIMEDOUT do
assert_raises Trilogy::TimeoutError do
client.query("SELECT SLEEP(1)")
end
ensure
Expand Down Expand Up @@ -429,7 +429,7 @@ def test_connect_timeout
serv = TCPServer.new(0)
port = serv.addr[1]

assert_raises Errno::ETIMEDOUT do
assert_raises Trilogy::TimeoutError do
new_tcp_client(host: "127.0.0.1", port: port, connect_timeout: 0.1)
end
ensure
Expand Down Expand Up @@ -738,7 +738,7 @@ def test_connection_refused
_, fake_port = fake_server.addr
fake_server.close

assert_raises Errno::ECONNREFUSED do
assert_raises Trilogy::BaseConnectionError do
new_tcp_client(host: "127.0.0.1", port: fake_port)
end
end
Expand Down

0 comments on commit fa2f945

Please sign in to comment.