Skip to content

Commit

Permalink
Fix socket timeout test (#144)
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
Co-authored-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
  • Loading branch information
mattdeekay and susodapop authored Jul 12, 2023
1 parent 22e5aaa commit 1eef432
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
- Fix: Revised SQLAlchemy dialect and examples for compatibility with SQLAlchemy==1.3.x (#173)
- Fix: oauth would fail if expired credentials appeared in ~/.netrc (#122)
- Fix: Python HTTP proxies were broken after switch to urllib3 (#158)
- Other: Relax pandas dependency constraint to allow ^2.0.0 (#164)
- Other: Connector now logs operation handle guids as hexadecimal instead of bytes (#170)
- Add support for Cloud Fetch
- Other: test_socket_timeout_user_defined e2e test was broken (#144)

## 2.7.0 (2023-06-26)

Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/test_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import pytz
import thrift
import pytest
from urllib3.connectionpool import ReadTimeoutError

import databricks.sql as sql
from databricks.sql import STRING, BINARY, NUMBER, DATETIME, DATE, DatabaseError, Error, OperationalError, RequestError
Expand Down Expand Up @@ -509,12 +510,11 @@ def test_socket_timeout(self):
def test_socket_timeout_user_defined(self):
# We expect to see a TimeoutError when the socket timeout is only
# 1 sec for a query that takes longer than that to process
with self.assertRaises(RequestError) as cm:
with self.assertRaises(ReadTimeoutError) as cm:
with self.cursor({"_socket_timeout": 1}) as cursor:
query = "select * from range(10000000)"
query = "select * from range(1000000000)"
cursor.execute(query)

self.assertIsInstance(cm.exception.args[1], TimeoutError)

def test_ssp_passthrough(self):
for enable_ansi in (True, False):
Expand Down

0 comments on commit 1eef432

Please sign in to comment.