[fix](test) Fix some testcases #34203

This commit is contained in:
zclllyybb
2024-04-28 20:16:53 +08:00
committed by yiguolei
parent b15fc2a906
commit 75470ede1a
3 changed files with 14 additions and 9 deletions

View File

@ -45,6 +45,7 @@ suite("test_dup_table_auto_inc_start_value_basic") {
file 'auto_inc_basic.csv'
time 10000 // limit inflight 10s
}
sql " sync "
qt_auto_inc_ids "select * from ${table1};"
sql "drop table if exists ${table1};"
@ -77,6 +78,7 @@ suite("test_dup_table_auto_inc_start_value_basic") {
file 'auto_inc_basic.csv'
time 10000 // limit inflight 10s
}
sql " sync "
qt_auto_inc_ids "select * from ${table2} order by id;"
sql "drop table if exists ${table2};"
@ -108,6 +110,7 @@ suite("test_dup_table_auto_inc_start_value_basic") {
file 'auto_inc_basic.csv'
time 10000 // limit inflight 10s
}
sql " sync "
qt_auto_inc_ids "select * from ${table3};"
sql "drop table if exists ${table3};"

View File

@ -20,11 +20,9 @@
suite("test_create_table_auto_partition") {
def testTable = "test_create_table_auto_partition_table"
sql "DROP TABLE IF EXISTS ${testTable}"
sql "DROP TABLE IF EXISTS test_create_table_auto_partition_table"
sql """
CREATE TABLE `${testTable}` (
CREATE TABLE `test_create_table_auto_partition_table` (
`TIME_STAMP` datev2 NOT NULL COMMENT 'Date of collection'
) ENGINE=OLAP
DUPLICATE KEY(`TIME_STAMP`)
@ -38,7 +36,7 @@ suite("test_create_table_auto_partition") {
"""
// The AUTO PARTITION func call must wrapped with ().
def text = sql_return_maparray "show create table ${testTable}"
def text = sql_return_maparray "show create table test_create_table_auto_partition_table"
def createTable = text[0]['Create Table']
assertTrue(createTable.contains("AUTO PARTITION BY RANGE (date_trunc(`TIME_STAMP`, 'month')"))
}

View File

@ -77,13 +77,17 @@ suite("test_iot_auto_detect") {
qt_sql " select * from list1 order by k0; "
// with label - transactions
sql """ insert overwrite table list1 partition(*) with label `txn1` values ("BEIJING"), ("7654321"); """
sql """ insert overwrite table list1 partition(*) with label `txn2` values ("SHANGHAI"), ("LIST"); """
sql """ insert overwrite table list1 partition(*) with label `txn3` values ("XXX"); """
def uniqueID1 = Math.abs(UUID.randomUUID().hashCode()).toString()
def uniqueID2 = Math.abs(UUID.randomUUID().hashCode()).toString()
def uniqueID3 = Math.abs(UUID.randomUUID().hashCode()).toString()
sql """ insert overwrite table list1 partition(*) with label `iot_auto_txn${uniqueID1}` values ("BEIJING"), ("7654321"); """
sql """ insert overwrite table list1 partition(*) with label `iot_auto_txn${uniqueID2}` values ("SHANGHAI"), ("LIST"); """
sql """ insert overwrite table list1 partition(*) with label `iot_auto_txn${uniqueID3}` values ("XXX"); """
def max_try_milli_secs = 10000
while(max_try_milli_secs) {
def result = sql " show load where label like 'txn_' "
def result = sql " show load where label like 'iot_auto_txn%' order by LoadStartTime desc "
// the last three loads are loads upper
if(result[0][2] == "FINISHED" && result[1][2] == "FINISHED" && result[2][2] == "FINISHED" ) {
break
} else {