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

yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git


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

commit 8dad59471d061b7c05fecfa664bc148081fa2598
Author: yujun <[email protected]>
AuthorDate: Tue Jun 2 13:50:47 2026 +0800

    branch-4.1: [fix](regression) fix unstable 
test_audit_log_internal_query_failure due to other cases modify global vars 
#63030 (#63943)
    
    cherry-pick: #63030
---
 .../org/apache/doris/regression/suite/Suite.groovy       | 13 +++++++++++++
 .../suites/audit/test_audit_log_behavior.groovy          | 16 +++-------------
 2 files changed, 16 insertions(+), 13 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 3c14e06eeb2..fc3811202bd 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
@@ -2323,8 +2323,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"
+  })
+
 }


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

Reply via email to