From 14a60f6448ddced2f94e053aeb1d28dc475dd6b3 Mon Sep 17 00:00:00 2001 From: wangbo <506340561@qq.com> Date: Fri, 17 May 2024 14:33:38 +0800 Subject: [PATCH] Add upgrade test for workload group --- .../workload_manager_p0/test_check_wg.out | 6 ++++ .../suites/workload_manager_p0/load.groovy | 33 +++++++++++++++++++ .../workload_manager_p0/test_check_wg.groovy | 19 +++++++++++ .../workload_manager_p0/test_curd_wlg.groovy | 7 ---- 4 files changed, 58 insertions(+), 7 deletions(-) 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..1f0a440ba0ba98 --- /dev/null +++ b/regression-test/data/workload_manager_p0/test_check_wg.out @@ -0,0 +1,6 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !select_wg -- +normal +upgrade_g1 +upgrade_g2 + 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..bdbce4093adab9 --- /dev/null +++ b/regression-test/suites/workload_manager_p0/load.groovy @@ -0,0 +1,33 @@ +// 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 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..6c81338e703b89 --- /dev/null +++ b/regression-test/suites/workload_manager_p0/test_check_wg.groovy @@ -0,0 +1,19 @@ +// 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_select_wg "select name from information_schema.workload_groups where name in ('upgrade_g1','normal','upgrade_g2');" +} \ No newline at end of file diff --git a/regression-test/suites/workload_manager_p0/test_curd_wlg.groovy b/regression-test/suites/workload_manager_p0/test_curd_wlg.groovy index 62eb762ff9b8b6..4b54b9224c378d 100644 --- a/regression-test/suites/workload_manager_p0/test_curd_wlg.groovy +++ b/regression-test/suites/workload_manager_p0/test_curd_wlg.groovy @@ -76,13 +76,6 @@ suite("test_crud_wlg") { sql "ADMIN SET FRONTEND CONFIG ('enable_alter_queue_prop_sync' = 'true');" sql "ADMIN SET FRONTEND CONFIG ('query_queue_update_interval_ms' = '100');" - sql "create workload group if not exists normal " + - "properties ( " + - " 'cpu_share'='1024', " + - " 'memory_limit'='50%', " + - " 'enable_memory_overcommit'='true' " + - ");" - // reset normal group property sql "alter workload group normal properties ( 'cpu_share'='1024' );" sql "alter workload group normal properties ( 'memory_limit'='50%' );"