diff --git a/tests/analyzer_integration_broken_tests.txt b/tests/analyzer_integration_broken_tests.txt index f17f1b55252..c5ce0ef8ca5 100644 --- a/tests/analyzer_integration_broken_tests.txt +++ b/tests/analyzer_integration_broken_tests.txt @@ -8,4 +8,3 @@ test_merge_table_over_distributed/test.py::test_global_in test_merge_table_over_distributed/test.py::test_select_table_name_from_merge_over_distributed test_passing_max_partitions_to_read_remotely/test.py::test_default_database_on_cluster test_select_access_rights/test_main.py::test_alias_columns -test_sql_user_defined_functions_on_cluster/test.py::test_sql_user_defined_functions_on_cluster diff --git a/tests/integration/test_sql_user_defined_functions_on_cluster/test.py b/tests/integration/test_sql_user_defined_functions_on_cluster/test.py index c940998ec42..0bf03f545be 100644 --- a/tests/integration/test_sql_user_defined_functions_on_cluster/test.py +++ b/tests/integration/test_sql_user_defined_functions_on_cluster/test.py @@ -1,5 +1,5 @@ import pytest -from helpers.cluster import ClickHouseCluster +from helpers.cluster import ClickHouseCluster, ClickHouseInstance cluster = ClickHouseCluster(__file__) ch1 = cluster.add_instance( @@ -24,15 +24,17 @@ def started_cluster(): def test_sql_user_defined_functions_on_cluster(): - assert "Unknown function test_function" in ch1.query_and_get_error( - "SELECT test_function(1);" - ) - assert "Unknown function test_function" in ch2.query_and_get_error( - "SELECT test_function(1);" - ) - assert "Unknown function test_function" in ch3.query_and_get_error( - "SELECT test_function(1);" - ) + def check_function_does_not_exist(node: ClickHouseInstance): + error_message = node.query_and_get_error("SELECT test_function(1);") + assert ( + "Unknown function test_function" in error_message + or "Function with name 'test_function' does not exists. In scope SELECT test_function(1)" + in error_message + ) + + check_function_does_not_exist(ch1) + check_function_does_not_exist(ch2) + check_function_does_not_exist(ch3) ch1.query_with_retry( "CREATE FUNCTION test_function ON CLUSTER 'cluster' AS x -> x + 1;" @@ -43,12 +45,7 @@ def test_sql_user_defined_functions_on_cluster(): assert ch3.query("SELECT test_function(1);") == "2\n" ch2.query_with_retry("DROP FUNCTION test_function ON CLUSTER 'cluster'") - assert "Unknown function test_function" in ch1.query_and_get_error( - "SELECT test_function(1);" - ) - assert "Unknown function test_function" in ch2.query_and_get_error( - "SELECT test_function(1);" - ) - assert "Unknown function test_function" in ch3.query_and_get_error( - "SELECT test_function(1);" - ) + + check_function_does_not_exist(ch1) + check_function_does_not_exist(ch2) + check_function_does_not_exist(ch3)