From 7a702c7a094d814bca1e84152013c38a30888e16 Mon Sep 17 00:00:00 2001 From: Dmitriy Kruglov Date: Wed, 23 Oct 2024 10:51:03 +0200 Subject: [PATCH] improvement(test-stages): add skip test stages option for perf tests Add possibility to skip selected set of performance test stages. --- configurations/skip_test_stages.yaml | 2 ++ docs/skip-test-stages.md | 2 ++ performance_regression_alternator_test.py | 2 ++ performance_regression_gradual_grow_throughput.py | 3 ++- performance_regression_row_level_repair_test.py | 3 ++- performance_regression_test.py | 4 +++- 6 files changed, 13 insertions(+), 3 deletions(-) diff --git a/configurations/skip_test_stages.yaml b/configurations/skip_test_stages.yaml index 3e04c9f29b..e231312ab9 100644 --- a/configurations/skip_test_stages.yaml +++ b/configurations/skip_test_stages.yaml @@ -5,3 +5,5 @@ skip_test_stages: post_test_load: false nemesis: false data_validation: false + perf_preload_data: false + perf_steady_state_calc: false diff --git a/docs/skip-test-stages.md b/docs/skip-test-stages.md index a7fa3b4b89..91489c9502 100644 --- a/docs/skip-test-stages.md +++ b/docs/skip-test-stages.md @@ -16,6 +16,8 @@ For the moment, the following test stages can be skipped: - post_test_load - nemesis - data_validation +- perf_preload_data: false +- perf_steady_state_calc: false ### Configuration diff --git a/performance_regression_alternator_test.py b/performance_regression_alternator_test.py index b56aff30d7..8d0283447e 100644 --- a/performance_regression_alternator_test.py +++ b/performance_regression_alternator_test.py @@ -16,6 +16,7 @@ from performance_regression_test import PerformanceRegressionTest from sdcm.sct_events.group_common_events import ignore_operation_errors, ignore_alternator_client_errors from sdcm.utils import alternator +from sdcm.utils.decorators import optional_stage class PerformanceRegressionAlternatorTest(PerformanceRegressionTest): @@ -68,6 +69,7 @@ def create_cql_ks_and_table(self, field_number): y_id varchar primary key, {fields});""") + @optional_stage('perf_preload_data') def preload_data(self, compaction_strategy=None): # if test require a pre-population of data prepare_write_cmd = self.params.get('prepare_write_cmd') diff --git a/performance_regression_gradual_grow_throughput.py b/performance_regression_gradual_grow_throughput.py index 1e2c9d98bd..21eb29fc58 100644 --- a/performance_regression_gradual_grow_throughput.py +++ b/performance_regression_gradual_grow_throughput.py @@ -7,6 +7,7 @@ from typing import NamedTuple from performance_regression_test import PerformanceRegressionTest +from sdcm.utils.common import skip_optional_stage from sdcm.sct_events import Severity from sdcm.sct_events.system import TestFrameworkEvent from sdcm.results_analyze import PredefinedStepsTestPerformanceAnalyzer @@ -115,7 +116,7 @@ def _base_test_workflow(self, workload: Workload, test_name): num_loaders = len(self.loaders.nodes) self.run_fstrim_on_all_db_nodes() # run a write workload as a preparation - if workload.preload_data: + if workload.preload_data and not skip_optional_stage('perf_preload_data'): self.preload_data() self.wait_no_compactions_running(n=400, sleep_time=120) self.run_fstrim_on_all_db_nodes() diff --git a/performance_regression_row_level_repair_test.py b/performance_regression_row_level_repair_test.py index 00be4fcf35..54002eee89 100644 --- a/performance_regression_row_level_repair_test.py +++ b/performance_regression_row_level_repair_test.py @@ -19,7 +19,7 @@ import six from sdcm.tester import ClusterTester -from sdcm.utils.decorators import measure_time, retrying +from sdcm.utils.decorators import measure_time, retrying, optional_stage from test_lib.scylla_bench_tools import create_scylla_bench_table_query THOUSAND = 1000 @@ -63,6 +63,7 @@ def _update_cl_in_stress_cmd(self, str_stress_cmd, consistency_level): self.log.debug("Could not find a 'cl' parameter in stress command: {}".format(str_stress_cmd)) return str_stress_cmd + @optional_stage('perf_preload_data') def preload_data(self, consistency_level=None): # if test require a pre-population of data diff --git a/performance_regression_test.py b/performance_regression_test.py index 4a1b41808d..8a82b4f079 100644 --- a/performance_regression_test.py +++ b/performance_regression_test.py @@ -28,7 +28,7 @@ from sdcm.sct_events.filters import EventsSeverityChangerFilter from sdcm.sct_events.loaders import CassandraStressEvent from sdcm.sct_events.system import HWPerforanceEvent, InfoEvent -from sdcm.utils.decorators import log_run_info, latency_calculator_decorator +from sdcm.utils.decorators import log_run_info, latency_calculator_decorator, optional_stage from sdcm.utils.csrangehistogram import CSHistogramTagTypes from sdcm.utils.nemesis_utils.indexes import wait_for_view_to_be_built @@ -218,6 +218,7 @@ def _stop_load_when_nemesis_threads_end(self): extra_time_to_expiration=60): self.loaders.kill_stress_thread() + @optional_stage('perf_preload_data') def preload_data(self, compaction_strategy=None): # if test require a pre-population of data prepare_write_cmd = self.params.get('prepare_write_cmd') @@ -818,6 +819,7 @@ def _stop_stress_when_finished(self): # pylint: disable=no-self-use extra_time_to_expiration=60): self.loaders.kill_stress_thread() + @optional_stage('perf_steady_state_calc') @latency_calculator_decorator def steady_state_latency(self): # pylint: disable=no-self-use sleep_time = self.db_cluster.params.get('nemesis_interval') * 60