Skip to content

Commit 44b09b1

Browse files
committed
Fix failing tests
1 parent 9f8d98f commit 44b09b1

File tree

6 files changed

+29
-17
lines changed

6 files changed

+29
-17
lines changed

.github/workflows/publish-manual.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ jobs:
3636
virtualenvs-in-project: true
3737
installer-parallel: true
3838

39+
#----------------------------------------------
40+
# Step 3.5: Install Kerberos system dependencies
41+
#----------------------------------------------
42+
- name: Install Kerberos system dependencies
43+
run: |
44+
sudo apt-get update
45+
sudo apt-get install -y libkrb5-dev
46+
3947
# #----------------------------------------------
4048
# # Step 4: Load cached virtual environment (if available)
4149
# #----------------------------------------------

.github/workflows/publish-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ jobs:
3737
#----------------------------------------------
3838
# install dependencies if cache does not exist
3939
#----------------------------------------------
40+
- name: Install Kerberos system dependencies
41+
run: |
42+
sudo apt-get update
43+
sudo apt-get install -y libkrb5-dev
4044
- name: Install dependencies
4145
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
4246
run: poetry install --no-interaction --no-root

.github/workflows/publish.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ jobs:
3939
#----------------------------------------------
4040
# install dependencies if cache does not exist
4141
#----------------------------------------------
42+
- name: Install Kerberos system dependencies
43+
run: |
44+
sudo apt-get update
45+
sudo apt-get install -y libkrb5-dev
4246
- name: Install dependencies
4347
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
4448
run: poetry install --no-interaction --no-root

tests/e2e/common/retry_test_mixins.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def test_retry_max_count_not_exceeded(self, mock_send_telemetry, extra_params):
278278
THEN the connector issues six request (original plus five retries)
279279
before raising an exception
280280
"""
281-
with mocked_server_response(status=404) as mock_obj:
281+
with mocked_server_response(status=429, headers={"Retry-After": "0"}) as mock_obj:
282282
with pytest.raises(MaxRetryError) as cm:
283283
extra_params = {**extra_params, **self._retry_policy}
284284
with self.connection(extra_params=extra_params) as conn:
@@ -467,22 +467,21 @@ def test_retry_safe_execute_statement_retry_condition(self, extra_params):
467467
)
468468
def test_retry_abort_close_session_on_404(self, extra_params, caplog):
469469
"""GIVEN the connector sends a CloseSession command
470-
WHEN server sends a 404 (which is normally retried)
471-
THEN nothing is retried because 404 means the session already closed
470+
WHEN server sends a 404 (which is not retried since commit 41b28159)
471+
THEN nothing is retried because 404 is globally non-retryable
472472
"""
473473

474-
# First response is a Bad Gateway -> Result is the command actually goes through
475-
# Second response is a 404 because the session is no longer found
474+
# With the idempotency-based retry refactor, 404 is now globally non-retryable
475+
# regardless of command type. The close() method catches RequestError and proceeds.
476476
responses = [
477-
{"status": 502, "headers": {"Retry-After": "1"}, "redirect_location": None},
478477
{"status": 404, "headers": {}, "redirect_location": None},
479478
]
480479

481480
extra_params = {**extra_params, **self._retry_policy}
482481
with self.connection(extra_params=extra_params) as conn:
483482
with mock_sequential_server_responses(responses):
483+
# Should not raise an exception, the error is caught internally
484484
conn.close()
485-
assert "Session was closed by a prior request" in caplog.text
486485

487486
@pytest.mark.parametrize(
488487
"extra_params",
@@ -493,14 +492,13 @@ def test_retry_abort_close_session_on_404(self, extra_params, caplog):
493492
)
494493
def test_retry_abort_close_operation_on_404(self, extra_params, caplog):
495494
"""GIVEN the connector sends a CancelOperation command
496-
WHEN server sends a 404 (which is normally retried)
497-
THEN nothing is retried because 404 means the operation was already canceled
495+
WHEN server sends a 404 (which is not retried since commit 41b28159)
496+
THEN nothing is retried because 404 is globally non-retryable
498497
"""
499498

500-
# First response is a Bad Gateway -> Result is the command actually goes through
501-
# Second response is a 404 because the session is no longer found
499+
# With the idempotency-based retry refactor, 404 is now globally non-retryable
500+
# regardless of command type. The close() method catches RequestError and proceeds.
502501
responses = [
503-
{"status": 502, "headers": {"Retry-After": "1"}, "redirect_location": None},
504502
{"status": 404, "headers": {}, "redirect_location": None},
505503
]
506504

@@ -515,10 +513,8 @@ def test_retry_abort_close_operation_on_404(self, extra_params, caplog):
515513
# This call guarantees we have an open cursor at the server
516514
curs.execute("SELECT 1")
517515
with mock_sequential_server_responses(responses):
516+
# Should not raise an exception, the error is caught internally
518517
curs.close()
519-
assert (
520-
"Operation was canceled by a prior request" in caplog.text
521-
)
522518

523519
@pytest.mark.parametrize(
524520
"extra_params",

tests/e2e/common/staging_ingestion_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def test_staging_ingestion_life_cycle(self, ingestion_user):
8181
# GET after REMOVE should fail
8282

8383
with pytest.raises(
84-
Error, match="too many 404 error responses"
84+
Error, match="Staging operation over HTTP was unsuccessful: 404"
8585
):
8686
cursor = conn.cursor()
8787
query = f"GET 'stage://tmp/{ingestion_user}/tmp/11/16/file1.csv' TO '{new_temp_path}'"

tests/e2e/common/uc_volume_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def test_uc_volume_life_cycle(self, catalog, schema):
8181
# GET after REMOVE should fail
8282

8383
with pytest.raises(
84-
Error, match="too many 404 error responses"
84+
Error, match="Staging operation over HTTP was unsuccessful: 404"
8585
):
8686
cursor = conn.cursor()
8787
query = f"GET '/Volumes/{catalog}/{schema}/e2etests/file1.csv' TO '{new_temp_path}'"

0 commit comments

Comments
 (0)