Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(data-warehouse): merge duplicate snowflake non-retryable test classes (#63228)

George Munyorocaf2da0fe2bb
diff --git a/posthog/temporal/data_imports/sources/snowflake/tests/test_snowflake.py b/posthog/temporal/data_imports/sources/snowflake/tests/test_snowflake.py
index 1ae0a141bcfc..33e67fff2561 100644
--- a/posthog/temporal/data_imports/sources/snowflake/tests/test_snowflake.py
+++ b/posthog/temporal/data_imports/sources/snowflake/tests/test_snowflake.py
@@ -479,22 +479,6 @@ class TestGetRowsToSync:
# ---------------------------------------------------------------------------
-class TestSnowflakeSourceNonRetryableErrors:
- @pytest.mark.parametrize(
- "error_msg",
- [
- "Duo Security authentication is denied",
- # The real shape from production: codes + host vary, but the Duo substring is stable.
- "250001 (08001): None: Failed to connect to DB: wv65496-re80354.snowflakecomputing.com:443. "
- "Duo Security authentication is denied.",
- ],
- )
- def test_duo_security_denied_is_non_retryable(self, error_msg):
- non_retryable = SnowflakeSource().get_non_retryable_errors()
- is_non_retryable = any(pattern in error_msg for pattern in non_retryable.keys())
- assert is_non_retryable
-
-
class TestBuildPipeline:
def test_builds_source_response_and_streams(self, impl):
# Two separate cursors: one for metadata pass, one for streaming.
@@ -577,6 +561,20 @@ class TestSnowflakeSourceNonRetryableErrors:
is_non_retryable = any(pattern in error_msg for pattern in non_retryable.keys())
assert is_non_retryable, f"Disabled-user error should be non-retryable: {error_msg}"
+ @pytest.mark.parametrize(
+ "error_msg",
+ [
+ "Duo Security authentication is denied",
+ # The real shape from production: codes + host vary, but the Duo substring is stable.
+ "250001 (08001): None: Failed to connect to DB: wv65496-re80354.snowflakecomputing.com:443. "
+ "Duo Security authentication is denied.",
+ ],
+ )
+ def test_duo_security_denied_is_non_retryable(self, source, error_msg):
+ non_retryable = source.get_non_retryable_errors()
+ is_non_retryable = any(pattern in error_msg for pattern in non_retryable.keys())
+ assert is_non_retryable, f"Duo-denied error should be non-retryable: {error_msg}"
+
@pytest.mark.parametrize(
"error_msg",
[