This is an automated email from the ASF dual-hosted git repository.
gopidesu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 5432c6e5c3c Fix StopIteration in snowflake sql tests (#52394)
5432c6e5c3c is described below
commit 5432c6e5c3cc2c2c7ecebaee9716999c6337843c
Author: GPK <[email protected]>
AuthorDate: Sun Jun 29 19:58:55 2025 +0100
Fix StopIteration in snowflake sql tests (#52394)
---
.../snowflake/tests/unit/snowflake/hooks/test_snowflake_sql_api.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git
a/providers/snowflake/tests/unit/snowflake/hooks/test_snowflake_sql_api.py
b/providers/snowflake/tests/unit/snowflake/hooks/test_snowflake_sql_api.py
index 2cbf156a2c9..7170eac36f4 100644
--- a/providers/snowflake/tests/unit/snowflake/hooks/test_snowflake_sql_api.py
+++ b/providers/snowflake/tests/unit/snowflake/hooks/test_snowflake_sql_api.py
@@ -1107,7 +1107,9 @@ class TestSnowflakeSqlApiHook:
# Simulate a query that keeps running and never finishes
hook.get_sql_api_query_status = mock.MagicMock(return_value={"status":
"running"})
- time_mock.side_effect = list(range(5))
+
+ # More side effects to ensure we hit the timeout and avoid
StopIteration error
+ time_mock.side_effect = list(range(10))
qid = "qid-789"
timeout = 3
@@ -1120,7 +1122,7 @@ class TestSnowflakeSqlApiHook:
sleep_mock.assert_has_calls([mock.call(1)] * 3)
assert hook.get_sql_api_query_status.call_count == 4
hook.get_sql_api_query_status.assert_has_calls([mock.call(query_id=qid)] * 4)
- assert time_mock.call_count == 5
+ assert time_mock.call_count >= 3
@mock.patch(f"{HOOK_PATH}._make_api_call_with_retries")
@mock.patch(f"{HOOK_PATH}._process_response")