Skip to content

Commit

Permalink
[enhancement](test) Fix test_show_data_warehouse case not stable (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
SWJTU-ZhangLei authored Sep 25, 2024
1 parent 368bfdb commit 5979f3c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
14 changes: 0 additions & 14 deletions regression-test/data/show_p0/test_show_data_warehouse.out

This file was deleted.

24 changes: 19 additions & 5 deletions regression-test/suites/show_p0/test_show_data_warehouse.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}; """
Expand Down

0 comments on commit 5979f3c

Please sign in to comment.