Skip to content

Commit

Permalink
improvement(test-stages): add skip test stages option for perf tests
Browse files Browse the repository at this point in the history
Add possibility to skip selected set of performance test stages.
  • Loading branch information
dimakr authored and fruch committed Oct 28, 2024
1 parent 9b54d48 commit 7a702c7
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions configurations/skip_test_stages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions docs/skip-test-stages.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions performance_regression_alternator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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')
Expand Down
3 changes: 2 additions & 1 deletion performance_regression_gradual_grow_throughput.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion performance_regression_row_level_repair_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion performance_regression_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7a702c7

Please sign in to comment.