Skip to content

Move temporary dir deletion to inner function, delete temp dir in skipped benchmarks #245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 58 additions & 12 deletions redis_benchmarks_specification/__runner__/runner.py
Original file line number Diff line number Diff line change
@@ -359,6 +359,19 @@ def process_self_contained_coordinator_stream(
resp_version=None,
override_memtier_test_time=0,
):
def delete_temporary_files(
temporary_dir_client, full_result_path, benchmark_tool_global
):
if preserve_temporary_client_dirs is True:
logging.info(f"Preserving temporary client dir {temporary_dir_client}")
else:
if "redis-benchmark" in benchmark_tool_global:
if full_result_path is not None:
os.remove(full_result_path)
logging.info("Removing temporary JSON file")
shutil.rmtree(temporary_dir_client, ignore_errors=True)
logging.info(f"Removing temporary client dir {temporary_dir_client}")

overall_result = True
results_matrix = []
total_test_suite_runs = 0
@@ -507,6 +520,11 @@ def process_self_contained_coordinator_stream(
test_name, maxmemory, benchmark_required_memory
)
)
delete_temporary_files(
temporary_dir_client=temporary_dir_client,
full_result_path=None,
benchmark_tool_global=benchmark_tool_global,
)
continue

reset_commandstats(redis_conns)
@@ -543,13 +561,23 @@ def process_self_contained_coordinator_stream(
test_name, priority_upper_limit, priority
)
)
delete_temporary_files(
temporary_dir_client=temporary_dir_client,
full_result_path=None,
benchmark_tool_global=benchmark_tool_global,
)
continue
if priority < priority_lower_limit:
logging.warning(
"Skipping test {} giving the priority limit ({}) is bellow the priority value ({})".format(
test_name, priority_lower_limit, priority
)
)
delete_temporary_files(
temporary_dir_client=temporary_dir_client,
full_result_path=None,
benchmark_tool_global=benchmark_tool_global,
)
continue
logging.info(
"Test {} priority ({}) is within the priority limit [{},{}]".format(
@@ -567,10 +595,20 @@ def process_self_contained_coordinator_stream(
test_name
)
)
delete_temporary_files(
temporary_dir_client=temporary_dir_client,
full_result_path=None,
benchmark_tool_global=benchmark_tool_global,
)
continue

if dry_run is True:
dry_run_count = dry_run_count + 1
delete_temporary_files(
temporary_dir_client=temporary_dir_client,
full_result_path=None,
benchmark_tool_global=benchmark_tool_global,
)
continue

if "preload_tool" in benchmark_config["dbconfig"]:
@@ -598,6 +636,11 @@ def process_self_contained_coordinator_stream(
logging.warning(
"Skipping this test given preload result was false"
)
delete_temporary_files(
temporary_dir_client=temporary_dir_client,
full_result_path=None,
benchmark_tool_global=benchmark_tool_global,
)
continue
execute_init_commands(
benchmark_config, r, dbconfig_keyname="dbconfig"
@@ -618,6 +661,11 @@ def process_self_contained_coordinator_stream(

if dry_run_include_preload is True:
dry_run_count = dry_run_count + 1
delete_temporary_files(
temporary_dir_client=temporary_dir_client,
full_result_path=None,
benchmark_tool_global=benchmark_tool_global,
)
continue

benchmark_tool = extract_client_tool(benchmark_config)
@@ -692,6 +740,11 @@ def process_self_contained_coordinator_stream(
logging.warning(
"Forcing skip this test given there is an arbitrary commmand and memtier usage. Check https://github.com/RedisLabs/memtier_benchmark/pull/117 ."
)
delete_temporary_files(
temporary_dir_client=temporary_dir_client,
full_result_path=None,
benchmark_tool_global=benchmark_tool_global,
)
continue

client_container_image = extract_client_container_image(
@@ -899,18 +952,11 @@ def process_self_contained_coordinator_stream(
shutil.copy(full_result_path, dest_fpath)
overall_result &= test_result

if preserve_temporary_client_dirs is True:
logging.info(
f"Preserving temporary client dir {temporary_dir_client}"
)
else:
if "redis-benchmark" in benchmark_tool_global:
os.remove(full_result_path)
logging.info("Removing temporary JSON file")
shutil.rmtree(temporary_dir_client, ignore_errors=True)
logging.info(
f"Removing temporary client dir {temporary_dir_client}"
)
delete_temporary_files(
temporary_dir_client=temporary_dir_client,
full_result_path=full_result_path,
benchmark_tool_global=benchmark_tool_global,
)

table_name = "Results for entire test-suite"
results_matrix_headers = [