From 5bc43fa3e5a4a353f07893b7c8cc7ce0c7348209 Mon Sep 17 00:00:00 2001 From: Jamison Date: Wed, 27 May 2026 16:09:30 -0700 Subject: [PATCH 1/3] NO-SNOW: Disable flaky AI tests for a while. --- src/conftest.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/conftest.py b/src/conftest.py index c32872ed7b..c7e159c53c 100644 --- a/src/conftest.py +++ b/src/conftest.py @@ -2,6 +2,7 @@ # # Copyright (c) 2012-2025 Snowflake Computing Inc. All rights reserved. # +import datetime import doctest import logging import os @@ -100,6 +101,16 @@ def pytest_collection_modifyitems(config, items): This function is used to skip some doctests on certain conditions. For example, some functions in PrPr might not be available on Azure and GCP. """ + # Mark flaky tests as xfail for a time + if datetime.date.today() <= datetime.date(2026, 6, 4): + xfail_ai = pytest.mark.xfail( + reason="dataframe_ai_functions doctests flaky due to infrastructure issues", + strict=False, + ) + for item in items: + if isinstance(item, DoctestItem) and "dataframe_ai_functions" in item.name: + item.add_marker(xfail_ai) + host = ( conn_params.get("host") or conn_params.get("HOST") or conn_params.get("account") ) @@ -113,6 +124,6 @@ def pytest_collection_modifyitems(config, items): for item in items: # identify doctest items if isinstance(item, DoctestItem): - # match by the test’s “name” (module.name) + # match by the test's "name" (module.name) if any(test_name in item.name for test_name in disabled_doctests): item.add_marker(skip) From 3a5908dda5713f7d26842ce526f507bfb6eeeb07 Mon Sep 17 00:00:00 2001 From: Jamison Date: Wed, 27 May 2026 16:39:53 -0700 Subject: [PATCH 2/3] increase name matching --- src/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conftest.py b/src/conftest.py index c7e159c53c..f33dbb32e2 100644 --- a/src/conftest.py +++ b/src/conftest.py @@ -108,7 +108,7 @@ def pytest_collection_modifyitems(config, items): strict=False, ) for item in items: - if isinstance(item, DoctestItem) and "dataframe_ai_functions" in item.name: + if isinstance(item, DoctestItem) and "dataframe_ai" in item.name: item.add_marker(xfail_ai) host = ( From 600707623a40d6754e4cc7bfae6f7326317d4d41 Mon Sep 17 00:00:00 2001 From: Jamison Date: Wed, 27 May 2026 17:07:31 -0700 Subject: [PATCH 3/3] Mark regular test suites as well. --- tests/integ/test_dataframe_ai.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/integ/test_dataframe_ai.py b/tests/integ/test_dataframe_ai.py index 3037954f41..dc6f280b60 100644 --- a/tests/integ/test_dataframe_ai.py +++ b/tests/integ/test_dataframe_ai.py @@ -2,6 +2,7 @@ # Copyright (c) 2012-2025 Snowflake Computing Inc. All rights reserved. # +import datetime import json import pytest from snowflake.snowpark.functions import ai_complete, col, lit, to_file @@ -15,6 +16,11 @@ "config.getoption('local_testing_mode', default=False)", reason="AI functions are not yet supported in local testing mode.", ), + pytest.mark.xfail( + datetime.date.today() <= datetime.date(2026, 6, 4), + reason="AI tests flaky due to infrastructure issues", + strict=False, + ), ]