github-actions[bot] commented on code in PR #65100:
URL: https://github.com/apache/doris/pull/65100#discussion_r3504714499


##########
regression-test/suites/fault_injection_p0/test_create_function_rollback.groovy:
##########
@@ -0,0 +1,52 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+import org.apache.doris.regression.suite.ClusterOptions
+
+suite("test_create_function_rollback", "docker") {
+    def options = new ClusterOptions()
+    options.feConfigs += [
+        "enable_debug_points=true"
+    ]
+    options.cloudMode = false
+
+    docker(options) {
+        sql """DROP FUNCTION IF EXISTS doris_25021_fn(INT)"""
+        sql """DROP FUNCTION IF EXISTS doris_25021_fn(BIGINT)"""
+        sql """CREATE ALIAS FUNCTION doris_25021_fn(INT) WITH PARAMETER(x) AS 
add(x, 1)"""
+
+        try {
+            GetDebugPoint().enableDebugPointForAllFEs(
+                    "FunctionUtil.translateToNereidsThrows.exception", 
[execute: 1])
+            test {
+                sql """CREATE ALIAS FUNCTION doris_25021_fn(BIGINT) WITH 
PARAMETER(x) AS add(x, 1)"""
+                exception "debug point 
FunctionUtil.translateToNereidsThrows.exception"
+            }
+        } finally {
+            
GetDebugPoint().disableDebugPointForAllFEs("FunctionUtil.translateToNereidsThrows.exception")
+        }
+
+        test {
+            sql """CREATE ALIAS FUNCTION doris_25021_fn(INT) WITH PARAMETER(x) 
AS add(x, 1)"""
+            exception "function already exists"
+        }
+        test {
+            sql """DROP FUNCTION doris_25021_fn(BIGINT)"""
+            exception "function does not exist"

Review Comment:
   This assertion is checking for an error string that this `DROP FUNCTION` 
path does not emit. For a missing overload, `Database.dropFunction()` first 
calls `getFunction()`; when the BIGINT overload is absent, 
`FunctionUtil.getFunction()` throws `Unknown function, function=...`, and 
`Database.dropFunction()` wraps that before the lower-level 
`dropFunctionImpl()` branch that says `function does not exist` can run. The 
regression framework checks `msg.contains(exception)`, so this test will fail 
even when the rollback behavior is correct. Please assert the actual `Unknown 
function` substring here, or use a custom check that accepts the current drop 
path's error.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to