You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
compare.py leaves temporary output files behind on benchmark failures #2349
tools/compare.py creates an output file with mkstemp when --benchmark_out is absent, but removes it only after both the benchmark process and JSON loading succeed. A nonzero exit, launch error, invalid JSON or unsupported result schema leaves the tool-owned file behind.
I reproduced this through the actual comparison CLI on main 1fa8ea1c: point TMPDIR / TMP / TEMP at an empty directory and compare the real Python executable against itself with -- -c "raise SystemExit(7)". The command exits 7 as expected, but one temporary result file remains. A child returning invalid JSON leaves one too. Successful comparisons clean up correctly.
The expected behavior is to remove only automatically created output on these error paths. An explicitly supplied --benchmark_out must remain available, including after a failed benchmark. A child that already removes its temporary output should retain its original exit code.
I have a focused fix and regression tests ready: the four cleanup regressions fail on the current code, while success and user-owned output controls already pass.
I used AI assistance for analysis, implementation, tests, validation, review and drafting this contribution.
Activity