Skip to content

Commit df82e52

Browse files
committed
fix: Add null check before shutil.copy to prevent NoneType error
This fixes a crash when processing redis-benchmark tests where full_result_path is None. The test execution and metrics collection complete successfully, but the file preservation step would fail. Changes: - Add null check before shutil.copy(full_result_path, dest_fpath) - Log warning message when result path is unavailable - Prevents TypeError: stat: path should be string, not NoneType Fixes issue observed in: - memtier_benchmark-nokeys-pubsub-mixed-100-channels test - Other redis-benchmark output conversion scenarios
1 parent 683cda5 commit df82e52

File tree

1 file changed

+12
-5
lines changed
  • redis_benchmarks_specification/__runner__

1 file changed

+12
-5
lines changed

redis_benchmarks_specification/__runner__/runner.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3101,12 +3101,19 @@ def delete_temporary_files(
31013101
client_aggregated_results_folder,
31023102
local_benchmark_output_filename,
31033103
)
3104-
logging.info(
3105-
"Preserving local results file {} into {}".format(
3106-
full_result_path, dest_fpath
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+
)
31073116
)
3108-
)
3109-
shutil.copy(full_result_path, dest_fpath)
31103117
overall_result &= test_result
31113118

31123119
delete_temporary_files(

0 commit comments

Comments
 (0)