Skip to content

Commit de75914

Browse files
committed
Fix TypeError for pubsub-sub-bench tests: add missing result path handler
- Add handler for pubsub-sub-bench in single-client result path construction - Previously only memtier_benchmark and vector-db-benchmark had handlers - This caused full_result_path to remain as bare filename without directory - Add safety check before shutil.copy to prevent crashes and provide better error messages - Fixes: TypeError when full_result_path is None for pubsub/mixed tests
1 parent 1a6094d commit de75914

File tree

1 file changed

+20
-5
lines changed
  • redis_benchmarks_specification/__runner__

1 file changed

+20
-5
lines changed

redis_benchmarks_specification/__runner__/runner.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2948,6 +2948,10 @@ def delete_temporary_files(
29482948
full_result_path = "{}/{}".format(
29492949
temporary_dir_client, local_benchmark_output_filename
29502950
)
2951+
elif "pubsub-sub-bench" in benchmark_tool:
2952+
full_result_path = "{}/{}".format(
2953+
temporary_dir_client, local_benchmark_output_filename
2954+
)
29512955
elif "vector-db-benchmark" in benchmark_tool:
29522956
# For vector-db-benchmark, look for summary JSON file
29532957
summary_files = [
@@ -3123,12 +3127,23 @@ def delete_temporary_files(
31233127
client_aggregated_results_folder,
31243128
local_benchmark_output_filename,
31253129
)
3126-
logging.info(
3127-
"Preserving local results file {} into {}".format(
3128-
full_result_path, dest_fpath
3130+
# Safety check: ensure full_result_path exists before copying
3131+
if full_result_path is None:
3132+
logging.error(
3133+
f"Cannot preserve results: full_result_path is None for test {test_name}. "
3134+
f"This may indicate a missing benchmark tool handler in the result path construction."
31293135
)
3130-
)
3131-
shutil.copy(full_result_path, dest_fpath)
3136+
elif not os.path.exists(full_result_path):
3137+
logging.error(
3138+
f"Cannot preserve results: file does not exist at {full_result_path} for test {test_name}"
3139+
)
3140+
else:
3141+
logging.info(
3142+
"Preserving local results file {} into {}".format(
3143+
full_result_path, dest_fpath
3144+
)
3145+
)
3146+
shutil.copy(full_result_path, dest_fpath)
31323147
overall_result &= test_result
31333148

31343149
delete_temporary_files(

0 commit comments

Comments
 (0)