This is an automated email from the ASF dual-hosted git repository.

starocean999 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new ba86267294c [fix](regression) fix unstable 
test_audit_log_internal_query_failure due to other cases modify global vars 
(#63030)
ba86267294c is described below

commit ba86267294c1f0f93d01a06c7a8d26284280796b
Author: yujun <[email protected]>
AuthorDate: Mon Jun 1 11:31:04 2026 +0800

    [fix](regression) fix unstable test_audit_log_internal_query_failure due to 
other cases modify global vars (#63030)
    
    Related PR: #62908
---
 .../org/apache/doris/regression/suite/Suite.groovy       | 13 +++++++++++++
 .../suites/audit/test_audit_log_behavior.groovy          | 16 +++-------------
 .../suites/audit/test_audit_log_queue_time.groovy        | 12 +++---------
 .../test_audit_log_internal_query_failure.groovy         |  7 ++++++-
 4 files changed, 25 insertions(+), 23 deletions(-)

diff --git 
a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy
 
b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy
index 58d2c76de2b..74e0fb0ee2c 100644
--- 
a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy
+++ 
b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy
@@ -2431,8 +2431,21 @@ class Suite implements GroovyInterceptable {
                 origin.put(key, rows[0].Value as String)
             }
         }
+
         try {
             tempVars.each { key, value -> sql "set global ${key} = 
${quote(value)}" }
+        } catch (Exception e) {
+            def err = e.getMessage()
+            log.warn("skip this case ${context.suiteName}, because ${err}")
+            if (err.toUpperCase().contains("ADMIN")) {
+                return
+            }
+
+            origin.each { key, value -> sql "set global ${key} = 
${quote(value)}" }
+            throw e
+        }
+
+        try {
             actionSupplier()
         } finally {
             origin.each { key, value -> sql "set global ${key} = 
${quote(value)}" }
diff --git a/regression-test/suites/audit/test_audit_log_behavior.groovy 
b/regression-test/suites/audit/test_audit_log_behavior.groovy
index a20e0ef9271..f705b6a17e8 100644
--- a/regression-test/suites/audit/test_audit_log_behavior.groovy
+++ b/regression-test/suites/audit/test_audit_log_behavior.groovy
@@ -16,16 +16,8 @@
 // under the License.
 
 suite("test_audit_log_behavior","nonConcurrent") {
-    try {
-        sql "set global enable_audit_plugin = true"
-        sql "set global audit_plugin_max_sql_length = 58"
-        // sql "set global audit_plugin_max_batch_interval_sec = 1"
-    } catch (Exception e) {
-        log.warn("skip this case, because " + e.getMessage())
-        assertTrue(e.getMessage().toUpperCase().contains("ADMIN"))
-        return
-    }
 
+ setGlobalVarTemporary([enable_audit_plugin: true, 
audit_plugin_max_sql_length: 58], {
     sql "drop table if exists audit_log_behavior"
     sql """
         CREATE TABLE `audit_log_behavior` (
@@ -99,8 +91,6 @@ suite("test_audit_log_behavior","nonConcurrent") {
         assertEquals(tuple2[1].toString(), res[0][0].toString())
     }
 
-    // do not turn off
-    sql "set global enable_audit_plugin = false"
-    sql "set global audit_plugin_max_sql_length = 4096"
-    sql "set global audit_plugin_max_batch_interval_sec = 60"
+  })
+
 }
diff --git a/regression-test/suites/audit/test_audit_log_queue_time.groovy 
b/regression-test/suites/audit/test_audit_log_queue_time.groovy
index e40d1688c42..1cf14d79bab 100644
--- a/regression-test/suites/audit/test_audit_log_queue_time.groovy
+++ b/regression-test/suites/audit/test_audit_log_queue_time.groovy
@@ -16,14 +16,8 @@
 // under the License.
 
 suite("test_audit_log_queue_time", "nonConcurrent") {
-    // Check admin privilege
-    try {
-        sql "set global enable_audit_plugin = true"
-    } catch (Exception e) {
-        log.warn("skip this case, because " + e.getMessage())
-        assertTrue(e.getMessage().toUpperCase().contains("ADMIN"))
-        return
-    }
+
+ setGlobalVarTemporary([enable_audit_plugin: true], {
 
     def tableName = "audit_queue_time_test"
     def wgName = "test_queue_time_wg"
@@ -125,5 +119,5 @@ suite("test_audit_log_queue_time", "nonConcurrent") {
     // Cleanup
     sql "drop table if exists ${tableName}"
     sql "drop workload group if exists ${wgName}"
-    sql "set global enable_audit_plugin = false"
+  })
 }
diff --git 
a/regression-test/suites/fault_injection_p0/test_audit_log_internal_query_failure.groovy
 
b/regression-test/suites/fault_injection_p0/test_audit_log_internal_query_failure.groovy
index 4db56802e99..233187e582e 100644
--- 
a/regression-test/suites/fault_injection_p0/test_audit_log_internal_query_failure.groovy
+++ 
b/regression-test/suites/fault_injection_p0/test_audit_log_internal_query_failure.groovy
@@ -57,15 +57,20 @@ suite('test_audit_log_internal_query_failure', 
'nonConcurrent') {
                 GetDebugPoint().clearDebugPointsForAllBEs()
             }
 
+            def currentDb = (sql_return_maparray "select database() as 
db")[0].db.toString()
+            def fullTableName = "internal.${currentDb}.${tbl}"
+
             // Force a flush so the failed internal query is queryable from
             // __internal_schema.audit_log.
             // The failed gather SQL reads from our user table and runs as an
             // internal query; it must show up with state=ERR. Filter by start
             // time to avoid matching stale entries from previous runs.
+            // Use queried_tables_and_views instead of stmt because stmt can be
+            // truncated by audit_plugin_max_sql_length when running in CI.
             def query = """select state, error_code, error_message
                            from __internal_schema.audit_log
                            where is_internal = 1
-                             and stmt like '%${tbl}%'
+                             and array_contains(queried_tables_and_views, 
'${fullTableName}')
                              and state = 'ERR'
                              and `time` >= '${startTime}'
                            order by `time` desc limit 1"""


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

Reply via email to