From ae2c8536dec4368e0c4abea2d5174b6696bac390 Mon Sep 17 00:00:00 2001 From: Ruslan Valiyev Date: Sat, 14 Mar 2026 09:28:45 +0100 Subject: [PATCH] fix: avoid mutating summarize_args list in summarize() The summarize() function was calling .extend() on summarize_args in-place before the second subprocess.check_call(). This mutates the original list, making the function non-idempotent: repeated calls accumulate duplicate --output-format flags. Construct a new list for the JSON invocation instead. Fixes #10121 --- scripts/performance/benchmark_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/performance/benchmark_utils.py b/scripts/performance/benchmark_utils.py index da48ae372d81..333eed1e129e 100644 --- a/scripts/performance/benchmark_utils.py +++ b/scripts/performance/benchmark_utils.py @@ -23,8 +23,8 @@ def summarize(script, result_dir, summary_dir): with open(os.path.join(summary_dir, 'summary.txt'), 'wb') as f: subprocess.check_call(summarize_args, stdout=f) with open(os.path.join(summary_dir, 'summary.json'), 'wb') as f: - summarize_args.extend(['--output-format', 'json']) - subprocess.check_call(summarize_args, stdout=f) + json_args = summarize_args + ['--output-format', 'json'] + subprocess.check_call(json_args, stdout=f) def _get_s3transfer_performance_script(script_name):