Skip to content

Commit 2d451b6

Browse files
move extra_params to the back
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent 92ba484 commit 2d451b6

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

tests/e2e/common/retry_test_mixins.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,17 @@ class PySQLRetryTestsMixin:
160160
"_retry_delay_default": 0.5,
161161
}
162162

163+
@pytest.mark.parametrize(
164+
"extra_params",
165+
[
166+
{},
167+
{"use_sea": True},
168+
],
169+
)
163170
@patch("databricks.sql.telemetry.telemetry_client.TelemetryClient._send_telemetry")
164-
def test_retry_urllib3_settings_are_honored(self, mock_send_telemetry):
171+
def test_retry_urllib3_settings_are_honored(
172+
self, mock_send_telemetry, extra_params
173+
):
165174
"""Databricks overrides some of urllib3's configuration. This tests confirms that what configuration
166175
we DON'T override is preserved in urllib3's internals
167176
"""
@@ -189,7 +198,7 @@ def test_retry_urllib3_settings_are_honored(self, mock_send_telemetry):
189198
],
190199
)
191200
@patch("databricks.sql.telemetry.telemetry_client.TelemetryClient._send_telemetry")
192-
def test_oserror_retries(self, extra_params, mock_send_telemetry):
201+
def test_oserror_retries(self, mock_send_telemetry, extra_params):
193202
"""If a network error occurs during make_request, the request is retried according to policy"""
194203
with patch(
195204
"urllib3.connectionpool.HTTPSConnectionPool._validate_conn",
@@ -210,7 +219,7 @@ def test_oserror_retries(self, extra_params, mock_send_telemetry):
210219
],
211220
)
212221
@patch("databricks.sql.telemetry.telemetry_client.TelemetryClient._send_telemetry")
213-
def test_retry_max_count_not_exceeded(self, extra_params, mock_send_telemetry):
222+
def test_retry_max_count_not_exceeded(self, mock_send_telemetry, extra_params):
214223
"""GIVEN the max_attempts_count is 5
215224
WHEN the server sends nothing but 429 responses
216225
THEN the connector issues six request (original plus five retries)
@@ -231,7 +240,7 @@ def test_retry_max_count_not_exceeded(self, extra_params, mock_send_telemetry):
231240
],
232241
)
233242
@patch("databricks.sql.telemetry.telemetry_client.TelemetryClient._send_telemetry")
234-
def test_retry_exponential_backoff(self, extra_params, mock_send_telemetry):
243+
def test_retry_exponential_backoff(self, mock_send_telemetry, extra_params):
235244
"""GIVEN the retry policy is configured for reasonable exponential backoff
236245
WHEN the server sends nothing but 429 responses with retry-afters
237246
THEN the connector will use those retry-afters values as floor
@@ -467,7 +476,7 @@ def test_retry_abort_close_operation_on_404(self, extra_params, caplog):
467476
)
468477
@patch("databricks.sql.telemetry.telemetry_client.TelemetryClient._send_telemetry")
469478
def test_retry_max_redirects_raises_too_many_redirects_exception(
470-
self, extra_params, mock_send_telemetry
479+
self, mock_send_telemetry, extra_params
471480
):
472481
"""GIVEN the connector is configured with a custom max_redirects
473482
WHEN the DatabricksRetryPolicy is created
@@ -502,7 +511,7 @@ def test_retry_max_redirects_raises_too_many_redirects_exception(
502511
)
503512
@patch("databricks.sql.telemetry.telemetry_client.TelemetryClient._send_telemetry")
504513
def test_retry_max_redirects_unset_doesnt_redirect_forever(
505-
self, extra_params, mock_send_telemetry
514+
self, mock_send_telemetry, extra_params
506515
):
507516
"""GIVEN the connector is configured without a custom max_redirects
508517
WHEN the DatabricksRetryPolicy is used

0 commit comments

Comments
 (0)