Skip to content

Commit 3d42435

Browse files
Improved error reply on ssh check and module checks (#410)
* Improved error reply on ssh check and module checks * flake8 fixes * Fixed remote envs timeout checks
1 parent e86f0c2 commit 3d42435

17 files changed

+36
-23
lines changed

redisbench_admin/profilers/daemon.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ def profile_stop(profiler_name, pid):
282282

283283

284284
def main():
285-
286285
_, project_description, project_version = populate_with_poetry_data()
287286
project_name = "perf-daemon"
288287
parser = argparse.ArgumentParser(

redisbench_admin/profilers/perf_daemon_caller.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,4 @@ def stop_profile(self, **kwargs):
128128
return result
129129

130130
def generate_outputs(self, use_case, **kwargs):
131-
132131
return self.result, self.outputs, self.tabular_data_map

redisbench_admin/profilers/profilers_local.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ def get_profilers_map(profilers_list, total_involved_processes, max_profilers=1)
259259
perf = Perf()
260260
profilers_map[profiler_name].append(perf)
261261
if "vtune" in profiler_name:
262-
263262
for profilers_per_type in range(total_involved_processes):
264263
logging.info(
265264
"Preparing Intel(R) VTune(TM) profiler for proc {} of {}".format(

redisbench_admin/run/common.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,6 @@ def run_redis_pre_steps(benchmark_config, r, required_modules):
560560
)
561561
search_specific_init(r, module_names)
562562
if required_modules is not None and len(required_modules) > 0:
563-
564563
check_required_modules(module_names, required_modules)
565564

566565
version = artifact_versions[0]
@@ -611,7 +610,6 @@ def dso_check(dso, local_module_file):
611610
if dso is None:
612611
logging.warning("No dso specified for perf analysis {}".format(dso))
613612
if local_module_file is not None:
614-
615613
if type(local_module_file) == str:
616614
dso = local_module_file
617615
logging.warning(

redisbench_admin/run/modules.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def redis_modules_check(local_module_files):
2323
local_module_file
2424
)
2525
logging.error(error_message)
26+
status = False
2627
else:
2728
logging.info(
2829
"Confirmed that module artifact: '{}' exists!".format(

redisbench_admin/run/redistimeseries.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ def timeseries_test_sucess_flow(
304304
branch_target_table_keyname,
305305
branch_target_table_dict,
306306
) in branch_target_tables.items():
307-
308307
logging.info(
309308
"Setting target table by branch on key {}".format(
310309
branch_target_table_keyname

redisbench_admin/run/ssh.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ def check_connection(ssh_conn):
7272
def ssh_pem_check(EC2_PRIVATE_PEM, private_key):
7373
if os.path.exists(private_key) is False:
7474
if EC2_PRIVATE_PEM is not None and EC2_PRIVATE_PEM != "":
75-
logging.info("Given env variable EC2_PRIVATE_PEM exists")
75+
logging.info(
76+
"Given env variable EC2_PRIVATE_PEM exists saving it into {}".format(
77+
private_key
78+
)
79+
)
7680
with open(private_key, "w") as tmp_private_key_file:
7781
pem_str = check_and_fix_pem_str(EC2_PRIVATE_PEM)
7882
tmp_private_key_file.write(pem_str)

redisbench_admin/run_local/local_db.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ def local_db_spin(
136136
raise Exception("Redis process is not alive. Failing test.")
137137

138138
if setup_type == "oss-cluster":
139-
140139
cluster_init_steps(clusterconfig, redis_conns, local_module_file)
141140

142141
if check_dbconfig_tool_requirement(benchmark_config):

redisbench_admin/run_remote/notifications.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ def generate_failure_notification(
1717
branch=None,
1818
tag=None,
1919
):
20-
2120
headline_test = "❌ FAILED CI job named {} in repo {}/{} due to {}".format(
2221
job_name, gh_org, gh_repo, failure_reason
2322
)
@@ -45,7 +44,6 @@ def generate_new_pr_comment_notification(
4544
regression_count,
4645
action,
4746
):
48-
4947
headline_test = "👨‍💻 {} PR Performance comment in repo {}/{}\n".format(
5048
action, gh_org, gh_repo
5149
)

redisbench_admin/run_remote/run_remote.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ def run_remote_command_logic(args, project_name, project_version):
379379
s3_bucket_name, test_name, tf_github_org, tf_github_repo
380380
)
381381
if setup_type in args.allowed_envs:
382-
383382
logging.info(
384383
"Starting setup named {} of topology type {}. Total primaries: {}".format(
385384
setup_name, setup_type, shard_count
@@ -422,7 +421,6 @@ def run_remote_command_logic(args, project_name, project_version):
422421
# after we've created the env, even on error we should always teardown
423422
# in case of some unexpected error we fail the test
424423
try:
425-
426424
(
427425
_,
428426
_,

redisbench_admin/run_remote/standalone.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def spin_up_standalone_remote_redis(
2727
modules_configuration_parameters_map={},
2828
redis_7=True,
2929
):
30-
3130
full_logfile, initial_redis_cmd = generate_remote_standalone_redis_cmd(
3231
logfile,
3332
redis_configuration_parameters,
@@ -77,7 +76,6 @@ def remote_module_files_cp(
7776
remote_module_files = []
7877
if local_module_files is not None:
7978
for local_module_file in local_module_files:
80-
8179
splitted_module_and_plugins = local_module_file.split(" ")
8280
if len(splitted_module_and_plugins) > 1:
8381
logging.info(
@@ -117,6 +115,11 @@ def remote_module_files_cp(
117115
remote_module_files_in = remote_module_files_in + " "
118116
remote_module_files_in = remote_module_files_in + remote_module_file
119117
remote_module_files.append(remote_module_files_in)
118+
logging.info(
119+
"There are a total of {} remote files {}".format(
120+
len(remote_module_files), remote_module_files
121+
)
122+
)
120123
return remote_module_files
121124

122125

@@ -151,6 +154,9 @@ def generate_remote_standalone_redis_cmd(
151154
command, remote_module_files, modules_configuration_parameters_map
152155
)
153156
if type(remote_module_files) == list:
157+
logging.info(
158+
"There are a total of {} modules".format(len(remote_module_files))
159+
)
154160
for mod in remote_module_files:
155161
redis_server_config_module_part(
156162
command, mod, modules_configuration_parameters_map

redisbench_admin/utils/benchmark_config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ def extract_benchmark_type_from_config(
344344
benchmark_config_present = False
345345
benchmark_type = None
346346
if config_key in benchmark_config:
347-
348347
if type(benchmark_config[config_key]) == list:
349348
for entry in benchmark_config[config_key]:
350349
if benchmark_type_key in entry:

redisbench_admin/utils/remote.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,6 @@ def common_timeseries_extraction(
725725
target_tables = {}
726726
cleaned_metrics_arr = extract_results_table(metrics, results_dict)
727727
for cleaned_metric in cleaned_metrics_arr:
728-
729728
metric_jsonpath = cleaned_metric[0]
730729
metric_context_path = cleaned_metric[1]
731730
metric_name = cleaned_metric[2]

tests/test_benchmark_config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,10 @@ def test_process_benchmark_definitions_remote_timeouts():
231231
)
232232
assert len(remote_envs_timeout.keys()) == 2
233233
# we have the default timeout + the one specified
234-
assert list(remote_envs_timeout.values())[0] == 600 + 1200
234+
timeouts = list(remote_envs_timeout.values())
235+
timeouts.sort()
236+
assert (600 + 1200) in timeouts
237+
assert (3600 + 600 + 1200) in timeouts
235238

236239

237240
def test_get_testfiles_to_process():

tests/test_compare.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
def test_compare_command_logic():
13-
1413
rts_host = os.getenv("RTS_DATASINK_HOST", None)
1514
rts_port = 16379
1615
rts_pass = ""

tests/test_run_local.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,12 @@ def test_run_local_command_logic_redis_benchmark():
119119
run_local_command_logic(args, "tool", "v0")
120120
except SystemExit as e:
121121
assert e.code == 0
122-
123-
r = redis.Redis()
124-
total_keys = r.info("keyspace")["db0"]["keys"]
125-
r.shutdown(nosave=True)
126-
assert total_keys == 1000
122+
finally:
123+
r = redis.Redis()
124+
r.ping()
125+
total_keys = r.info("keyspace")["db0"]["keys"]
126+
r.shutdown(nosave=True)
127+
assert total_keys == 1000
127128

128129

129130
def test_run_local_command_logic():

tests/test_standalone.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,15 @@ def test_generate_remote_standalone_redis_cmd():
7373
"log1", None, ["m1.so"], ".", modules_configuration_parameters_map, False
7474
)
7575
assert initial_redis_cmd.endswith("m1.so CHUNK_SIZE_BYTES 128")
76+
77+
# 2 modules
78+
modules_configuration_parameters_map = {"m1": {"CHUNK_SIZE_BYTES": 128}}
79+
full_logfile, initial_redis_cmd = generate_remote_standalone_redis_cmd(
80+
"log1",
81+
None,
82+
["m1.so", "m2.so"],
83+
".",
84+
modules_configuration_parameters_map,
85+
False,
86+
)
87+
assert initial_redis_cmd.endswith("m2.so")

0 commit comments

Comments
 (0)