[chore](regression) prevent creating stmt failed in cold heat separation regression case #18391

Previously in cold_heat_separation regression, it just tries to create resources/policies. Sometimes if the former cases failed or BE crashed when doing cases the resources would not be cleared so the next time invoking this regression cases would result in failure.
This commit is contained in:
AlexYue
2023-04-06 10:01:04 +08:00
committed by GitHub
parent f28c75bd80
commit 4db2ba226b
11 changed files with 25 additions and 25 deletions

View File

@ -51,7 +51,7 @@ suite("add_table_policy_by_alter_table") {
if (!storage_exist.call("created_create_table_alter_policy")) {
def create_s3_resource = try_sql """
CREATE RESOURCE "test_create_alter_table_use_resource"
CREATE RESOURCE IF NOT EXISTS "test_create_alter_table_use_resource"
PROPERTIES(
"type"="s3",
"AWS_REGION" = "bj",
@ -64,7 +64,7 @@ suite("add_table_policy_by_alter_table") {
);
"""
def create_succ_1 = try_sql """
CREATE STORAGE POLICY created_create_table_alter_policy
CREATE STORAGE POLICY IF NOT EXISTS created_create_table_alter_policy
PROPERTIES(
"storage_resource" = "test_create_alter_table_use_resource",
"cooldown_datetime" = "2025-06-08 00:00:00"
@ -87,7 +87,7 @@ suite("add_table_policy_by_alter_table") {
if (!storage_exist.call("created_create_table_alter_policy_1")) {
def create_s3_resource = try_sql """
CREATE RESOURCE "test_create_alter_table_use_resource_1"
CREATE RESOURCE IF NOT EXISTS "test_create_alter_table_use_resource_1"
PROPERTIES(
"type"="s3",
"AWS_REGION" = "bj",
@ -100,7 +100,7 @@ suite("add_table_policy_by_alter_table") {
);
"""
def create_succ_1 = try_sql """
CREATE STORAGE POLICY created_create_table_alter_policy_1
CREATE STORAGE POLICY IF NOT EXISTS created_create_table_alter_policy_1
PROPERTIES(
"storage_resource" = "test_create_alter_table_use_resource_1",
"cooldown_datetime" = "2025-06-08 00:00:00"

View File

@ -47,7 +47,7 @@ suite("create_table_use_partition_policy") {
if (!storage_exist.call("test_create_table_partition_use_policy_1")) {
def create_s3_resource = try_sql """
CREATE RESOURCE "test_create_table_partition_use_resource_1"
CREATE RESOURCE IF NOT EXISTS "test_create_table_partition_use_resource_1"
PROPERTIES(
"type"="s3",
"AWS_REGION" = "bj",
@ -60,7 +60,7 @@ suite("create_table_use_partition_policy") {
);
"""
def create_succ_1 = try_sql """
CREATE STORAGE POLICY test_create_table_partition_use_policy_1
CREATE STORAGE POLICY IF NOT EXISTS test_create_table_partition_use_policy_1
PROPERTIES(
"storage_resource" = "test_create_table_partition_use_resource_1",
"cooldown_ttl" = "$cooldown_ttl"
@ -72,7 +72,7 @@ suite("create_table_use_partition_policy") {
if (!storage_exist.call("test_create_table_partition_use_policy_2")) {
def create_s3_resource = try_sql """
CREATE RESOURCE "test_create_table_partition_use_resource_2"
CREATE RESOURCE IF NOT EXISTS "test_create_table_partition_use_resource_2"
PROPERTIES(
"type"="s3",
"AWS_REGION" = "bj",
@ -85,7 +85,7 @@ suite("create_table_use_partition_policy") {
);
"""
def create_succ_1 = try_sql """
CREATE STORAGE POLICY test_create_table_partition_use_policy_2
CREATE STORAGE POLICY IF NOT EXISTS test_create_table_partition_use_policy_2
PROPERTIES(
"storage_resource" = "test_create_table_partition_use_resource_2",
"cooldown_ttl" = "$cooldown_ttl"

View File

@ -33,7 +33,7 @@ suite("disable_storage_policy_MoW"){
if(!storage_exist.call("${storage_policy_name}")){
def create_s3_resource = sql """
CREATE RESOURCE "${s3_source_name}"
CREATE RESOURCE IF NOT EXISTS "${s3_source_name}"
PROPERTIES(
"type"="s3",
"AWS_REGION" = "bj",
@ -46,7 +46,7 @@ suite("disable_storage_policy_MoW"){
);
"""
def create_storage_policy = sql """
CREATE STORAGE POLICY ${storage_policy_name} PROPERTIES(
CREATE STORAGE POLICY IF NOT EXISTS ${storage_policy_name} PROPERTIES(
"storage_resource" = "${s3_source_name}",
"cooldown_ttl" = "1008611"
);

View File

@ -52,7 +52,7 @@ suite("use_default_storage_policy") {
assertEquals(create_table_use_default_policy_but_not_set_default_policy_result, null);
def create_s3_resource = try_sql """
CREATE RESOURCE "default_s3_resource"
CREATE RESOURCE IF NOT EXISTS "default_s3_resource"
PROPERTIES(
"type"="s3",
"AWS_REGION" = "bj",
@ -65,7 +65,7 @@ suite("use_default_storage_policy") {
);
"""
def create_succ_1 = try_sql """
CREATE STORAGE POLICY default_storage_policy PROPERTIES(
CREATE STORAGE POLICY IF NOT EXISTS default_storage_policy PROPERTIES(
"storage_resource" = "default_s3_resource",
"cooldown_ttl" = "1008611"
);

View File

@ -31,7 +31,7 @@ suite("alter_policy") {
// create resource
def create_source = { resource_name ->
sql """
CREATE RESOURCE "${resource_name}"
CREATE RESOURCE IF NOT EXISTS "${resource_name}"
PROPERTIES(
"type"="s3",
"AWS_ENDPOINT" = "bj.s3.comaaaa",
@ -188,7 +188,7 @@ suite("alter_policy") {
check_resource_delete_if_exist(has_resource_policy_alter)
create_source(has_resource_policy_alter)
sql """
CREATE STORAGE POLICY has_resouce_policy_alter_policy
CREATE STORAGE POLICY IF NOT EXISTS has_resouce_policy_alter_policy
PROPERTIES(
"storage_resource" = "${has_resource_policy_alter}",
"cooldown_ttl" = "1d"

View File

@ -24,7 +24,7 @@ suite("create_policy") {
// normal
if(has_created_1.size() == 0) {
sql """
CREATE RESOURCE "crete_policy_1"
CREATE RESOURCE IF NOT EXISTS "crete_policy_1"
PROPERTIES(
"type" = "s3",
"AWS_ENDPOINT" = "bj.s3.comaaaa",

View File

@ -63,7 +63,7 @@ suite("drop_policy") {
def resource_table_use = "resource_table_use"
sql """
CREATE RESOURCE "${resource_table_use}"
CREATE RESOURCE IF NOT EXISTS "${resource_table_use}"
PROPERTIES(
"type"="s3",
"AWS_ENDPOINT" = "bj.s3.comaaaa",
@ -102,7 +102,7 @@ suite("drop_policy") {
assertEquals(drop_policy_ret.size(), 1)
def create_succ_2 = try_sql """
CREATE STORAGE POLICY drop_policy_test_has_table_binded
CREATE STORAGE POLICY IF NOT EXISTS drop_policy_test_has_table_binded
PROPERTIES(
"storage_resource" = "${resource_table_use}",
"cooldown_datetime" = "2025-06-08 00:00:00"

View File

@ -132,7 +132,7 @@ suite("create_table_use_partition_policy") {
}
sql """
CREATE RESOURCE "${resource_name}"
CREATE RESOURCE IF NOT EXISTS "${resource_name}"
PROPERTIES(
"type"="s3",
"AWS_ENDPOINT" = "${getS3Endpoint()}",
@ -149,7 +149,7 @@ suite("create_table_use_partition_policy") {
"""
sql """
CREATE STORAGE POLICY ${policy_name}
CREATE STORAGE POLICY IF NOT EXISTS ${policy_name}
PROPERTIES(
"storage_resource" = "${resource_name}",
"cooldown_ttl" = "300"

View File

@ -132,7 +132,7 @@ suite("create_table_use_policy") {
}
sql """
CREATE RESOURCE "${resource_name}"
CREATE RESOURCE IF NOT EXISTS "${resource_name}"
PROPERTIES(
"type"="s3",
"AWS_ENDPOINT" = "${getS3Endpoint()}",
@ -149,7 +149,7 @@ suite("create_table_use_policy") {
"""
sql """
CREATE STORAGE POLICY ${policy_name}
CREATE STORAGE POLICY IF NOT EXISTS ${policy_name}
PROPERTIES(
"storage_resource" = "${resource_name}",
"cooldown_ttl" = "300"

View File

@ -147,7 +147,7 @@ suite("modify_replica_use_partition") {
}
sql """
CREATE RESOURCE "${resource_name}"
CREATE RESOURCE IF NOT EXISTS "${resource_name}"
PROPERTIES(
"type"="s3",
"AWS_ENDPOINT" = "${getS3Endpoint()}",
@ -164,7 +164,7 @@ suite("modify_replica_use_partition") {
"""
sql """
CREATE STORAGE POLICY ${policy_name}
CREATE STORAGE POLICY IF NOT EXISTS ${policy_name}
PROPERTIES(
"storage_resource" = "${resource_name}",
"cooldown_ttl" = "300"

View File

@ -132,7 +132,7 @@ suite("table_modify_resouce") {
}
sql """
CREATE RESOURCE "${resource_name}"
CREATE RESOURCE IF NOT EXISTS "${resource_name}"
PROPERTIES(
"type"="s3",
"AWS_ENDPOINT" = "${getS3Endpoint()}",
@ -149,7 +149,7 @@ suite("table_modify_resouce") {
"""
sql """
CREATE STORAGE POLICY ${policy_name}
CREATE STORAGE POLICY IF NOT EXISTS ${policy_name}
PROPERTIES(
"storage_resource" = "${resource_name}",
"cooldown_ttl" = "300"