From a4e163a4f35d8e0a93920dc7c4b9dd8ceb15b668 Mon Sep 17 00:00:00 2001 From: seawinde Date: Thu, 14 Dec 2023 08:53:06 +0800 Subject: [PATCH] fix some regression test --- .../doris/regression/suite/Suite.groovy | 21 +++++++++++++++++++ .../mv/aggregate_with_roll_up.groovy | 3 +++ .../mv/aggregate_without_roll_up.groovy | 4 +++- .../nereids_rules_p0/mv/inner_join.groovy | 3 +++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy index 1ebe87c72ac44a..be43fce548f9ff 100644 --- a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy +++ b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy @@ -875,5 +875,26 @@ class Suite implements GroovyInterceptable { } return result.last().get(0); } + + void waiteCreateTableFinished(String tableName) { + Thread.sleep(2000); + String showCreateTable = "SHOW CREATE TABLE ${tableName}" + String createdTableName = ""; + List> result + long startTime = System.currentTimeMillis() + long timeoutTimestamp = startTime + 1 * 60 * 1000 // 1 min + do { + result = sql(showCreateTable) + if (!result.isEmpty()) { + createdTableName = result.last().get(0) + } + logger.info("create table result of ${showCreateTable} is ${createdTableName}") + Thread.sleep(500); + } while (timeoutTimestamp > System.currentTimeMillis() && createdTableName.isEmpty()) + if (createdTableName.isEmpty()) { + logger.info("create table is not success") + } + Assert.assertEquals(true, !createdTableName.isEmpty()) + } } diff --git a/regression-test/suites/nereids_rules_p0/mv/aggregate_with_roll_up.groovy b/regression-test/suites/nereids_rules_p0/mv/aggregate_with_roll_up.groovy index f59dc0440e7015..ff79e93196cd99 100644 --- a/regression-test/suites/nereids_rules_p0/mv/aggregate_with_roll_up.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/aggregate_with_roll_up.groovy @@ -95,14 +95,17 @@ suite("aggregate_with_roll_up") { ) """ + waiteCreateTableFinished("lineitem") sql """ insert into lineitem values (1, 2, 3, 4, 5.5, 6.5, 7.5, 8.5, 'o', 'k', '2023-12-08', '2023-12-09', '2023-12-10', 'a', 'b', 'yyyyyyyyy'), (2, 2, 3, 6, 7.5, 8.5, 9.5, 10.5, 'k', 'o', '2023-12-11', '2023-12-12', '2023-12-13', 'c', 'd', 'xxxxxxxxx');""" + waiteCreateTableFinished("orders") sql """ insert into orders values (1, 1, 'ok', 99.5, '2023-12-08', 'a', 'b', 1, 'yy'), (2, 2, 'ok', 109.2, '2023-12-09', 'c','d',2, 'mm'); """ + waiteCreateTableFinished("partsupp") sql """ insert into partsupp values (2, 3, 9, 10.01, 'supply1'), (2, 3, 10, 11.01, 'supply2'); diff --git a/regression-test/suites/nereids_rules_p0/mv/aggregate_without_roll_up.groovy b/regression-test/suites/nereids_rules_p0/mv/aggregate_without_roll_up.groovy index 8366d477028f9e..e4aa9969d1b995 100644 --- a/regression-test/suites/nereids_rules_p0/mv/aggregate_without_roll_up.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/aggregate_without_roll_up.groovy @@ -95,14 +95,16 @@ suite("aggregate_without_roll_up") { ) """ + waiteCreateTableFinished("lineitem"); sql """ insert into lineitem values (1, 2, 3, 4, 5.5, 6.5, 7.5, 8.5, 'o', 'k', '2023-12-08', '2023-12-09', '2023-12-10', 'a', 'b', 'yyyyyyyyy'), (2, 2, 3, 6, 7.5, 8.5, 9.5, 10.5, 'k', 'o', '2023-12-11', '2023-12-12', '2023-12-13', 'c', 'd', 'xxxxxxxxx');""" + waiteCreateTableFinished("orders"); sql """ insert into orders values (1, 1, 'ok', 99.5, '2023-12-08', 'a', 'b', 1, 'yy'), (2, 2, 'ok', 109.2, '2023-12-09', 'c','d',2, 'mm'); """ - + waiteCreateTableFinished("partsupp"); sql """ insert into partsupp values (2, 3, 9, 10.01, 'supply1'), (2, 3, 10, 11.01, 'supply2'); diff --git a/regression-test/suites/nereids_rules_p0/mv/inner_join.groovy b/regression-test/suites/nereids_rules_p0/mv/inner_join.groovy index 0acc9f39a4dd8b..dcff69b8ed303c 100644 --- a/regression-test/suites/nereids_rules_p0/mv/inner_join.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/inner_join.groovy @@ -95,14 +95,17 @@ suite("inner_join") { ) """ + waiteCreateTableFinished("lineitem") sql """ insert into lineitem values (1, 2, 3, 4, 5.5, 6.5, 7.5, 8.5, 'o', 'k', '2023-12-08', '2023-12-09', '2023-12-10', 'a', 'b', 'yyyyyyyyy'), (2, 2, 3, 6, 7.5, 8.5, 9.5, 10.5, 'k', 'o', '2023-12-11', '2023-12-12', '2023-12-13', 'c', 'd', 'xxxxxxxxx');""" + waiteCreateTableFinished("orders") sql """ insert into orders values (1, 1, 'ok', 99.5, '2023-12-08', 'a', 'b', 1, 'yy'), (2, 2, 'ok', 109.2, '2023-12-09', 'c','d',2, 'mm'); """ + waiteCreateTableFinished("partsupp") sql """ insert into partsupp values (2, 3, 9, 10.01, 'supply1'), (2, 3, 10, 11.01, 'supply2');