Skip to content

Commit 62055be

Browse files
aakash-saravanan-dbIsaac
andcommitted
test(e2e): delete never-collected 429/503 retry suites
HTTP429Suite and HTTP503Suite have not been collected since #352 moved their base class off unittest.TestCase: their names do not match pytest's Test* pattern. They also needed a server that returns real 429/503 responses. Remove them together with the mixins and the PySQLPytestTestCase attributes only they used. Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
1 parent 3004541 commit 62055be

3 files changed

Lines changed: 0 additions & 68 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ There are several e2e test suites available:
126126
- `PySQLCoreTestSuite`
127127
- `PySQLLargeQueriesSuite`
128128
- `PySQLStagingIngestionTestSuite`
129-
- `PySQLRetryTestSuite.HTTP503Suite` **[not documented]**
130-
- `PySQLRetryTestSuite.HTTP429Suite` **[not documented]**
131129
- `PySQLUnityCatalogTestSuite` **[not documented]**
132130

133131
To execute the core test suite:

‎tests/e2e/common/retry_test_mixins.py‎

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -48,49 +48,6 @@ def put_connection(pool, connection):
4848
yield mock_method
4949

5050

51-
class Client429ResponseMixin:
52-
def test_client_should_retry_automatically_when_getting_429(self):
53-
with self.cursor() as cursor:
54-
for _ in range(10):
55-
cursor.execute("SELECT 1")
56-
rows = cursor.fetchall()
57-
self.assertEqual(len(rows), 1)
58-
self.assertEqual(rows[0][0], 1)
59-
60-
def test_client_should_not_retry_429_if_RateLimitRetry_is_0(self):
61-
with pytest.raises(self.error_type) as cm:
62-
extra_params = {**self.conf_to_disable_rate_limit_retries}
63-
with self.cursor(extra_params) as cursor:
64-
for _ in range(10):
65-
cursor.execute("SELECT 1")
66-
rows = cursor.fetchall()
67-
self.assertEqual(len(rows), 1)
68-
self.assertEqual(rows[0][0], 1)
69-
expected = (
70-
"Maximum rate of 1 requests per SECOND has been exceeded. "
71-
"Please reduce the rate of requests and try again after 1 seconds."
72-
)
73-
exception_str = str(cm.exception)
74-
75-
# FIXME (Ali Smesseim, 7-Jul-2020): ODBC driver does not always return the
76-
# X-Thriftserver-Error-Message as-is. Re-enable once Simba resolves this flakiness.
77-
# Simba support ticket: https://magnitudesoftware.force.com/support/5001S000018RlaD
78-
# self.assertIn(expected, exception_str)
79-
80-
81-
class Client503ResponseMixin:
82-
def test_wait_cluster_startup(self):
83-
with self.cursor() as cursor:
84-
cursor.execute("SELECT 1")
85-
cursor.fetchall()
86-
87-
def _test_retry_disabled_with_message(self, error_msg_substring, exception_type):
88-
with pytest.raises(exception_type) as cm:
89-
with self.connection(self.conf_to_disable_temporarily_unavailable_retries):
90-
pass
91-
assert error_msg_substring in str(cm.exception)
92-
93-
9451
class SimpleHttpResponse:
9552
"""A simple HTTP response mock that works with both urllib3 v1.x and v2.x"""
9653

‎tests/e2e/test_driver.py‎

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@
4242
from tests.e2e.common.large_queries_mixin import fetch_rows
4343
from tests.e2e.common.timestamp_tests import TimestampTestsMixin
4444
from tests.e2e.common.decimal_tests import DecimalTestsMixin
45-
from tests.e2e.common.retry_test_mixins import (
46-
Client429ResponseMixin,
47-
Client503ResponseMixin,
48-
)
4945
from tests.e2e.common.staging_ingestion_tests import PySQLStagingIngestionTestSuiteMixin
5046
from tests.e2e.common.retry_test_mixins import PySQLRetryTestsMixin
5147

@@ -76,11 +72,6 @@ class PySQLPytestTestCase:
7672
so that we can use pytest.mark.parameterize
7773
"""
7874

79-
error_type = Error
80-
conf_to_disable_rate_limit_retries = {"_retry_stop_after_attempts_count": 1}
81-
conf_to_disable_temporarily_unavailable_retries = {
82-
"_retry_stop_after_attempts_count": 1
83-
}
8475
arraysize = 1000
8576
buffer_size_bytes = 104857600
8677
POLLING_INTERVAL = 2
@@ -1001,20 +992,6 @@ def test_row_limit_with_arrow_smaller_result(self):
1001992
), f"Expected {expected_rows} rows, got {arrow_table.num_rows}"
1002993

1003994

1004-
# use a RetrySuite to encapsulate these tests which we'll typically want to run together; however keep
1005-
# the 429/503 subsuites separate since they execute under different circumstances.
1006-
class TestPySQLRetrySuite:
1007-
class HTTP429Suite(Client429ResponseMixin, PySQLPytestTestCase):
1008-
pass # Mixin covers all
1009-
1010-
class HTTP503Suite(Client503ResponseMixin, PySQLPytestTestCase):
1011-
# 503Response suite gets custom error here vs PyODBC
1012-
def test_retry_disabled(self):
1013-
self._test_retry_disabled_with_message(
1014-
"TEMPORARILY_UNAVAILABLE", OperationalError
1015-
)
1016-
1017-
1018995
class TestPySQLUnityCatalogSuite(PySQLPytestTestCase):
1019996
"""Simple namespace tests that should be run against a unity-catalog-enabled cluster"""
1020997

0 commit comments

Comments
 (0)