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

yiguolei 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 f8de821d492 branch-2.1:[fix](regression)Fix test analyze mv case. 
(#50701) (#50751)
f8de821d492 is described below

commit f8de821d4920e803cefea833e5132aaed2899d76
Author: James <[email protected]>
AuthorDate: Fri May 9 17:38:40 2025 +0800

    branch-2.1:[fix](regression)Fix test analyze mv case. (#50701) (#50751)
    
    backport: https://github.com/apache/doris/pull/50701
---
 .../suites/statistics/test_analyze_mv.groovy            | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/regression-test/suites/statistics/test_analyze_mv.groovy 
b/regression-test/suites/statistics/test_analyze_mv.groovy
index b59b900f2bf..829a20d6ed7 100644
--- a/regression-test/suites/statistics/test_analyze_mv.groovy
+++ b/regression-test/suites/statistics/test_analyze_mv.groovy
@@ -63,7 +63,18 @@ suite("test_analyze_mv") {
             }
             throw new Exception("Row count report timeout.")
         }
+    }
 
+    def wait_local_row_count_reported = {table, index, row, column, expected ->
+        for (int i = 0; i < 120; i++) {
+            def result_row = sql """show index stats ${table} ${index}"""
+            logger.info("show index stats: " + result_row)
+            if (result_row[row][column] == expected) {
+                return;
+            }
+            Thread.sleep(5000)
+        }
+        throw new Exception("Row count report timeout.")
     }
 
     def wait_analyze_finish = { table ->
@@ -515,6 +526,10 @@ suite("test_analyze_mv") {
         logger.info(e.getMessage());
         return;
     }
+    wait_local_row_count_reported("mvTestDup", "mvTestDup", 0, 4, "6")
+    wait_local_row_count_reported("mvTestDup", "mv1", 0, 4, "6")
+    wait_local_row_count_reported("mvTestDup", "mv2", 0, 4, "6")
+    wait_local_row_count_reported("mvTestDup", "mv3", 0, 4, "4")
 
     if (!isCloudMode()) {
         // Test row count report and report for nereids
@@ -730,6 +745,7 @@ suite("test_analyze_mv") {
         assertEquals("0", result_row[0][4])
 
         // ** Embedded test for skip auto analyze when table is empty again
+        wait_row_count_reported("test_analyze_mv", "mvTestDup", 0, 4, "0")
         sql """analyze table mvTestDup properties ("use.auto.analyzer" = 
"true")"""
         stats_dropped("mvTestDup")
         empty_test = sql """show auto analyze mvTestDup"""
@@ -813,4 +829,3 @@ suite("test_analyze_mv") {
 
     sql """drop database if exists test_analyze_mv"""
 }
-


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

Reply via email to