From 87be9377b4a656d083b05befe822394173cbb0be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A0=E7=A3=8A?= Date: Tue, 11 Jun 2024 15:43:17 +0800 Subject: [PATCH] update task about sysbench_run_test_tenant_cpu_used.yaml --- handler/checker/check_handler.py | 12 +++++++----- .../sysbench/sysbench_run_test_tenant_cpu_used.yaml | 4 +++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/handler/checker/check_handler.py b/handler/checker/check_handler.py index bf39e011..a08b49df 100644 --- a/handler/checker/check_handler.py +++ b/handler/checker/check_handler.py @@ -138,7 +138,6 @@ def handle(self): if self.export_report_type not in ["table", "json", "xml", "yaml"]: raise CheckException("report_type must be table, json, xml, yaml") self.stdio.verbose("export_report_path is " + self.export_report_path) - # get package's by package_name self.tasks = {} if package_name: @@ -160,10 +159,13 @@ def handle(self): if len(filter_tasks) > 0: self.tasks = {key: value for key, value in self.tasks.items() if key not in filter_tasks} new_tasks = {} - for filter_task in filter_tasks: - for task_name, task_value in self.tasks.items(): - if re.match(filter_task.strip(), task_name.strip()) is None: - new_tasks[task_name] = task_value + for task_name, task_value in self.tasks.items(): + filter_tag = False + for filter_task in filter_tasks: + if re.match(filter_task.strip(), task_name.strip()): + filter_tag = True + if not filter_tag: + new_tasks[task_name] = task_value self.tasks = new_tasks self.stdio.verbose("tasks is {0}".format(self.tasks.keys())) except Exception as e: diff --git a/handler/checker/tasks/observer/sysbench/sysbench_run_test_tenant_cpu_used.yaml b/handler/checker/tasks/observer/sysbench/sysbench_run_test_tenant_cpu_used.yaml index cd1ac8a1..c6661589 100644 --- a/handler/checker/tasks/observer/sysbench/sysbench_run_test_tenant_cpu_used.yaml +++ b/handler/checker/tasks/observer/sysbench/sysbench_run_test_tenant_cpu_used.yaml @@ -1,4 +1,4 @@ -info: 'Check when sysbench free , cluster info about network_speed' +info: 'Check when sysbench run , cluster info about cpu' task: - version: "[4.0.0.0,*]" steps: @@ -9,6 +9,8 @@ FROM oceanbase.DBA_OB_TENANTS WHERE TENANT_TYPE='USER' limit 1;" result: set_value: tenant_id + verify: '[ -n "${tenant_id}" ]' + err_msg: "tenant_id is null . Please check your tenant without sys" - type: sql sql: 'select VALUE from oceanbase.GV$OB_PARAMETERS where Name="cpu_quota_concurrency" and TENANT_ID="#{tenant_id}"