From 3676bee0178f1f17711d793b7ed11353664890eb Mon Sep 17 00:00:00 2001 From: wangbo <506340561@qq.com> Date: Fri, 17 May 2024 12:23:06 +0800 Subject: [PATCH 1/3] Add workload group upgrade test --- .../workload_manager_p0/test_check_wg.out | 23 +++++++++++ .../suites/workload_manager_p0/load.groovy | 40 +++++++++++++++++++ .../workload_manager_p0/test_check_wg.groovy | 20 ++++++++++ 3 files changed, 83 insertions(+) create mode 100644 regression-test/data/workload_manager_p0/test_check_wg.out create mode 100644 regression-test/suites/workload_manager_p0/load.groovy create mode 100644 regression-test/suites/workload_manager_p0/test_check_wg.groovy diff --git a/regression-test/data/workload_manager_p0/test_check_wg.out b/regression-test/data/workload_manager_p0/test_check_wg.out new file mode 100644 index 00000000000000..85c8aa798e5635 --- /dev/null +++ b/regression-test/data/workload_manager_p0/test_check_wg.out @@ -0,0 +1,23 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !count_wg -- +3 + +-- !select_wg -- +normal cpu_share 10 +normal max_concurrency 2147483647 +normal max_queue_size 0 +normal memory_limit 30% +normal queue_timeout 0 +upgrade_g1 cpu_share 11 +upgrade_g1 enable_memory_overcommit true +upgrade_g1 max_concurrency 2147483647 +upgrade_g1 max_queue_size 0 +upgrade_g1 memory_limit 0.2% +upgrade_g1 queue_timeout 0 +upgrade_g2 cpu_share 12 +upgrade_g2 enable_memory_overcommit true +upgrade_g2 max_concurrency 2147483647 +upgrade_g2 max_queue_size 0 +upgrade_g2 memory_limit 0.3% +upgrade_g2 queue_timeout 0 + diff --git a/regression-test/suites/workload_manager_p0/load.groovy b/regression-test/suites/workload_manager_p0/load.groovy new file mode 100644 index 00000000000000..d662e77500ddec --- /dev/null +++ b/regression-test/suites/workload_manager_p0/load.groovy @@ -0,0 +1,40 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +suite("test_create_upgrade_wg") { + sql "ADMIN SET FRONTEND CONFIG ('enable_workload_group' = 'true');" + + sql "create workload group if not exists normal " + + "properties ( " + + " 'cpu_share'='10', " + + " 'memory_limit'='30%', " + + " 'enable_memory_overcommit'='true' " + + ");" + + sql "create workload group if not exists upgrade_g1 " + + "properties ( " + + " 'cpu_share'='11', " + + " 'memory_limit'='0.2%', " + + " 'enable_memory_overcommit'='true' " + + ");" + + sql "create workload group if not exists upgrade_g2 " + + "properties ( " + + " 'cpu_share'='12', " + + " 'memory_limit'='0.3%', " + + " 'enable_memory_overcommit'='true' " + + ");" +} \ No newline at end of file diff --git a/regression-test/suites/workload_manager_p0/test_check_wg.groovy b/regression-test/suites/workload_manager_p0/test_check_wg.groovy new file mode 100644 index 00000000000000..5dfe6e65fea91f --- /dev/null +++ b/regression-test/suites/workload_manager_p0/test_check_wg.groovy @@ -0,0 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +suite("test_check_wg") { + qt_count_wg "select count(distinct id) from workload_groups();" + qt_select_wg "select name,item,value from workload_groups() order by name,item,value;" +} \ No newline at end of file From 7663be93c34511e8bf02d9311410afe42a4ca640 Mon Sep 17 00:00:00 2001 From: wangbo <506340561@qq.com> Date: Tue, 28 May 2024 16:49:36 +0800 Subject: [PATCH 2/3] +1 --- regression-test/data/workload_manager_p0/test_check_wg.out | 1 + 1 file changed, 1 insertion(+) diff --git a/regression-test/data/workload_manager_p0/test_check_wg.out b/regression-test/data/workload_manager_p0/test_check_wg.out index 85c8aa798e5635..86049516b7676c 100644 --- a/regression-test/data/workload_manager_p0/test_check_wg.out +++ b/regression-test/data/workload_manager_p0/test_check_wg.out @@ -4,6 +4,7 @@ -- !select_wg -- normal cpu_share 10 +normal enable_memory_overcommit true normal max_concurrency 2147483647 normal max_queue_size 0 normal memory_limit 30% From ab43a88f4cf0ef75f7e289fda2551526c7fae3f7 Mon Sep 17 00:00:00 2001 From: wangbo <506340561@qq.com> Date: Tue, 28 May 2024 18:38:28 +0800 Subject: [PATCH 3/3] +1 --- regression-test/data/workload_manager_p0/test_check_wg.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regression-test/data/workload_manager_p0/test_check_wg.out b/regression-test/data/workload_manager_p0/test_check_wg.out index 86049516b7676c..5bad827bd4fcb6 100644 --- a/regression-test/data/workload_manager_p0/test_check_wg.out +++ b/regression-test/data/workload_manager_p0/test_check_wg.out @@ -4,7 +4,7 @@ -- !select_wg -- normal cpu_share 10 -normal enable_memory_overcommit true +normal enable_memory_overcommit true normal max_concurrency 2147483647 normal max_queue_size 0 normal memory_limit 30%