Skip to content

Commit 0748c88

Browse files
committed
Fix multi-client tests not writing aggregated results to files
Root cause: Multi-client tests were parsing aggregated JSON from stdout but never writing it to the expected output file. This caused: 1. full_result_path to remain None 2. Results not being preserved to aggregated results folder 3. Missing JSON files for multi-client tests (e.g., pubsub tests) Solution: Write the aggregated results_dict to local_benchmark_output_filename and set full_result_path appropriately, so the file preservation logic works. Also removed the None check workaround since it was masking the real issue.
1 parent df82e52 commit 0748c88

File tree

1 file changed

+13
-12
lines changed
  • redis_benchmarks_specification/__runner__

1 file changed

+13
-12
lines changed

redis_benchmarks_specification/__runner__/runner.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2885,6 +2885,14 @@ def delete_temporary_files(
28852885
)
28862886
results_dict = json.loads(client_container_stdout)
28872887

2888+
# Write aggregated results to file so it can be preserved
2889+
full_result_path = local_benchmark_output_filename
2890+
with open(full_result_path, "w") as json_file:
2891+
json.dump(results_dict, json_file, indent=2)
2892+
logging.info(
2893+
f"Wrote aggregated multi-client results to {full_result_path}"
2894+
)
2895+
28882896
# Validate benchmark metrics
28892897
is_valid, validation_error = validate_benchmark_metrics(
28902898
results_dict, test_name, benchmark_config, default_metrics
@@ -3101,19 +3109,12 @@ def delete_temporary_files(
31013109
client_aggregated_results_folder,
31023110
local_benchmark_output_filename,
31033111
)
3104-
if full_result_path is not None:
3105-
logging.info(
3106-
"Preserving local results file {} into {}".format(
3107-
full_result_path, dest_fpath
3108-
)
3109-
)
3110-
shutil.copy(full_result_path, dest_fpath)
3111-
else:
3112-
logging.warning(
3113-
"No result file path available to preserve for test {}".format(
3114-
local_benchmark_output_filename
3115-
)
3112+
logging.info(
3113+
"Preserving local results file {} into {}".format(
3114+
full_result_path, dest_fpath
31163115
)
3116+
)
3117+
shutil.copy(full_result_path, dest_fpath)
31173118
overall_result &= test_result
31183119

31193120
delete_temporary_files(

0 commit comments

Comments
 (0)