This is an automated email from the ASF dual-hosted git repository.
morningman 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 b87b09bb049 [Enhance](regression)enhance case test_broker_load_func
(#26118)
b87b09bb049 is described below
commit b87b09bb049a91d031873a56355307ddd0a1d6fb
Author: zhangguoqiang <[email protected]>
AuthorDate: Tue Oct 31 19:22:25 2023 +0800
[Enhance](regression)enhance case test_broker_load_func (#26118)
---
.../broker_load/test_broker_load_func.groovy | 34 +++++++++++++++++-----
1 file changed, 26 insertions(+), 8 deletions(-)
diff --git
a/regression-test/suites/external_table_p0/broker_load/test_broker_load_func.groovy
b/regression-test/suites/external_table_p0/broker_load/test_broker_load_func.groovy
index c3793c605a2..e15579a7ae9 100644
---
a/regression-test/suites/external_table_p0/broker_load/test_broker_load_func.groovy
+++
b/regression-test/suites/external_table_p0/broker_load/test_broker_load_func.groovy
@@ -25,13 +25,16 @@ suite("test_broker_load_func",
"p0,external,hive,external_docker,external_docker
String database_name = "test_broker_load_func"
String broker_name = "hdfs"
+ def uuid = UUID.randomUUID().toString().replaceAll("-", "")
+ def test_load_label="label_test_broker_load_func_${uuid}"
+ String table_name="simple"
sql """drop database if exists ${database_name}; """
sql """create database if not exists ${database_name};"""
sql """use ${database_name}; """
sql """
- create table simple (
+ create table ${table_name} (
`t_empty_string` varchar(255) NULL COMMENT '',
`t_string` varchar(255) NULL COMMENT ''
) engine=olap
@@ -42,10 +45,10 @@ suite("test_broker_load_func",
"p0,external,hive,external_docker,external_docker
"""
sql """
- LOAD LABEL ${database_name}.label_test_broker_load_func
+ LOAD LABEL ${database_name}.${test_load_label}
(
DATA
INFILE("hdfs://${externalEnvIp}:${hdfsPort}/user/doris/preinstalled_data/csv/csv_all_types/csv_all_types")
- INTO TABLE `simple`
+ INTO TABLE ${table_name}
COLUMNS TERMINATED BY ","
)
WITH BROKER ${broker_name}
@@ -55,11 +58,26 @@ suite("test_broker_load_func",
"p0,external,hive,external_docker,external_docker
);
"""
- sleep(10000)
-
- def res = sql """select count(*) from simple;"""
-
- assertEquals(10,res[0][0])
+ def check_load_result = {checklabel, testTablex ->
+ max_try_milli_secs = 60000
+ while(max_try_milli_secs) {
+ result = sql "show load where label = '${checklabel}'"
+ if(result[0][2] == "FINISHED") {
+ //sql "sync"
+ def res = sql "select count(*) from
${database_name}.${testTablex};"
+ assertEquals(10,res[0][0])
+ break
+ } else {
+ sleep(1000) // wait 1 second every time
+ max_try_milli_secs -= 1000
+ if(max_try_milli_secs <= 0) {
+ assertEquals(1, 2)
+ }
+ }
+ }
+ }
+
+ check_load_result.call(test_load_label, table_name)
} finally {
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]