From e7bf9d2b570f787757888227c45f6007c267a74e Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 22 Mar 2024 16:59:39 +1100 Subject: [PATCH] Tools: size_compare_branches.py: write out some.csv less racily The current construct wipes the old file before reading and collating the data and writing to the file. This meant the file was empty a lot of the time... Formulate the output then write to file.... --- Tools/scripts/size_compare_branches.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tools/scripts/size_compare_branches.py b/Tools/scripts/size_compare_branches.py index a7321448c1da1..5e6e29084f18d 100755 --- a/Tools/scripts/size_compare_branches.py +++ b/Tools/scripts/size_compare_branches.py @@ -483,8 +483,9 @@ def run_build_tasks_in_parallel(self, tasks): for task in tasks: task_results.append(self.gather_results_for_task(task)) # progress CSV: - with open("/tmp/some.csv", "w") as f: - f.write(self.csv_for_results(self.compare_task_results(task_results, no_elf_diff=True))) + csv_for_results = self.csv_for_results(self.compare_task_results(task_results, no_elf_diff=True)) + path = pathlib.Path("/tmp/some.csv") + path.write_text(csv_for_results) time.sleep(1) self.progress("All threads returned")