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

dataroaring 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 5979f3cce02 [enhancement](test) Fix `test_show_data_warehouse` case 
not stable (#41241)
5979f3cce02 is described below

commit 5979f3cce02c50ba757757d22917c8c7c2adf410
Author: Lei Zhang <27994433+swjtu-zhang...@users.noreply.github.com>
AuthorDate: Wed Sep 25 12:13:26 2024 +0800

    [enhancement](test) Fix `test_show_data_warehouse` case not stable (#41241)
---
 .../data/show_p0/test_show_data_warehouse.out      | 14 -------------
 .../suites/show_p0/test_show_data_warehouse.groovy | 24 +++++++++++++++++-----
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/regression-test/data/show_p0/test_show_data_warehouse.out 
b/regression-test/data/show_p0/test_show_data_warehouse.out
deleted file mode 100644
index ce415488232..00000000000
--- a/regression-test/data/show_p0/test_show_data_warehouse.out
+++ /dev/null
@@ -1,14 +0,0 @@
--- This file is automatically generated. You should know what you did if you 
want to edit this
--- !show_1 --
-SHOW_DATA_1    785     0
-total  785     0
-
--- !show_2 --
-SHOW_DATA_2    762     0
-total  762     0
-
--- !show_3 --
-SHOW_DATA_1    785     0
-SHOW_DATA_2    762     0
-total  1547    0
-
diff --git a/regression-test/suites/show_p0/test_show_data_warehouse.groovy 
b/regression-test/suites/show_p0/test_show_data_warehouse.groovy
index fb9af927f0b..e51434da0d3 100644
--- a/regression-test/suites/show_p0/test_show_data_warehouse.groovy
+++ b/regression-test/suites/show_p0/test_show_data_warehouse.groovy
@@ -74,6 +74,13 @@ suite("test_show_data_warehouse") {
     
         // wait for heartbeat
 
+        def res1 = sql """ show data from  ${db1Name}.`table`""";
+        def replicaCount1 = res1[0][3].toInteger();
+        def res2 = sql """ show data from  ${db2Name}.`table`""";
+        def replicaCount2 = res2[0][3].toInteger();
+        assertEquals(replicaCount1, replicaCount2);
+        log.info("replicaCount: ${replicaCount1}|${replicaCount2}");
+
         long start = System.currentTimeMillis()
         long dataSize = 0
         long current = -1
@@ -86,14 +93,21 @@ suite("test_show_data_warehouse") {
             sleep(30000)
         } while (current - start < 600000)
 
-        qt_show_1 """ show data 
properties("entire_warehouse"="true","db_names"="${db1Name}"); """
-
-        qt_show_2 """ show data 
properties("entire_warehouse"="true","db_names"="${db2Name}"); """
+        def result = sql """ show data 
properties("entire_warehouse"="true","db_names"="${db1Name}"); """
+        assertEquals(result.size(), 2)
+        assertEquals(result[0][1].toInteger(), 785 * replicaCount1)
 
-        qt_show_3 """ show data 
properties("entire_warehouse"="true","db_names"="${db1Name},${db2Name}"); """
+        result = sql """ show data 
properties("entire_warehouse"="true","db_names"="${db2Name}"); """
+        assertEquals(result.size(), 2)
+        assertEquals(result[0][1].toInteger(), 762 * replicaCount1)
 
-        def result = sql """show data properties("entire_warehouse"="true")"""
+        result = sql """ show data 
properties("entire_warehouse"="true","db_names"="${db1Name},${db2Name}"); """
+        assertEquals(result.size(), 3)
+        assertEquals(result[0][1].toInteger(), 785 * replicaCount1)
+        assertEquals(result[1][1].toInteger(), 762 * replicaCount1)
+        assertEquals(result[2][1].toInteger(), (785 + 762) * replicaCount1)
 
+        result = sql """show data properties("entire_warehouse"="true")"""
         assertTrue(result.size() >= 3)
 
         sql """ DROP DATABASE IF EXISTS ${db1Name}; """


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to