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

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


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new d0e73710772 [Test](bloom filter) add retry and retry timeout for bloom 
filter test case #42609 (#42672)
d0e73710772 is described below

commit d0e7371077281c00073edb0d33c89da208aa49db
Author: airborne12 <[email protected]>
AuthorDate: Tue Oct 29 13:33:02 2024 +0800

    [Test](bloom filter) add retry and retry timeout for bloom filter test case 
#42609 (#42672)
    
    cherry pick from #42609
---
 .../test_bloom_filter_drop_column.groovy           | 29 +++++++++++++++++++---
 ...est_bloom_filter_hit_with_renamed_column.groovy |  4 +--
 2 files changed, 27 insertions(+), 6 deletions(-)

diff --git 
a/regression-test/suites/bloom_filter_p0/test_bloom_filter_drop_column.groovy 
b/regression-test/suites/bloom_filter_p0/test_bloom_filter_drop_column.groovy
index a2de2426832..39c4cdb6141 100644
--- 
a/regression-test/suites/bloom_filter_p0/test_bloom_filter_drop_column.groovy
+++ 
b/regression-test/suites/bloom_filter_p0/test_bloom_filter_drop_column.groovy
@@ -50,6 +50,29 @@ suite("test_bloom_filter_drop_column") {
         }
         assertTrue(useTime <= OpTimeout, "wait_for_latest_op_on_table_finish 
timeout")
     }
+
+    def assertShowCreateTableWithRetry = { tableName, expectedCondition, 
maxRetries, waitSeconds ->
+        int attempt = 0
+        while (attempt < maxRetries) {
+            def res = sql """SHOW CREATE TABLE ${tableName}"""
+            log.info("Attempt ${attempt + 1}: show table: ${res}")
+            if (res && res.size() > 0 && 
res[0][1].contains(expectedCondition)) {
+                logger.info("Attempt ${attempt + 1}: Condition met.")
+                return
+            } else {
+                logger.warn("Attempt ${attempt + 1}: Condition not met. 
Retrying after ${waitSeconds} second(s)...")
+            }
+            attempt++
+            if (attempt < maxRetries) {
+                sleep(waitSeconds * 1000)
+            }
+        }
+        def finalRes = sql """SHOW CREATE TABLE ${tableName}"""
+        log.info("Final attempt: show table: ${finalRes}")
+        assertTrue(finalRes && finalRes.size() > 0, "SHOW CREATE TABLE return 
empty or null")
+        assertTrue(finalRes[0][1].contains(expectedCondition), 
"expected\"${expectedCondition}\",actural: ${finalRes[0][1]}")
+    }
+
     sql """INSERT INTO ${table_name} values ('1', '1')"""
 
     qt_select """select * from ${table_name} order by a"""
@@ -58,10 +81,8 @@ suite("test_bloom_filter_drop_column") {
     sql """ALTER TABLE ${table_name} DROP COLUMN c1"""
     wait_for_latest_op_on_table_finish(table_name, timeout)
 
-    // show create table
-    def res = sql """SHOW CREATE TABLE ${table_name}"""
-    log.info("show table:{}", res);
-    assert res[0][1].contains("\"bloom_filter_columns\" = \"\"")
+    // show create table with retry logic
+    assertShowCreateTableWithRetry(table_name, "\"bloom_filter_columns\" = 
\"\"", 3, 30)
 
     // add new column c1
     sql """ALTER TABLE ${table_name} ADD COLUMN c1 ARRAY<STRING>"""
diff --git 
a/regression-test/suites/bloom_filter_p0/test_bloom_filter_hit_with_renamed_column.groovy
 
b/regression-test/suites/bloom_filter_p0/test_bloom_filter_hit_with_renamed_column.groovy
index 46d2e766109..c86be96d4b1 100644
--- 
a/regression-test/suites/bloom_filter_p0/test_bloom_filter_hit_with_renamed_column.groovy
+++ 
b/regression-test/suites/bloom_filter_p0/test_bloom_filter_hit_with_renamed_column.groovy
@@ -123,7 +123,7 @@ suite("test_bloom_filter_hit_with_renamed_column") {
 
         while (attempt < maxRetries) {
             profiles = httpGet(profileUrl)
-            log.debug("profiles attempt ${attempt + 1}: {}", profiles)
+            log.info("profiles attempt ${attempt + 1}: {}", profiles)
             if (profiles == null) {
                 log.warn("Failed to fetch profiles on attempt ${attempt + 1}")
             } else {
@@ -156,7 +156,7 @@ suite("test_bloom_filter_hit_with_renamed_column") {
     }
 
     def query = """select C_COMMENT_NEW from ${tableName} where 
C_COMMENT_NEW='OK'"""
-    def profileId = getProfileIdWithRetry(query, 3, 1)
+    def profileId = getProfileIdWithRetry(query, 3, 30)
     log.info("profileId:{}", profileId)
     def profileDetail = httpGet("/rest/v1/query_profile/" + profileId)
     log.info("profileDetail:{}", profileDetail)


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

Reply via email to