Repository navigation
fix(cli): fail benchmarks with no completed renders - #5303
Conversation
jrusso1020
left a comment
There was a problem hiding this comment.
Confirmed main's benchmark.ts records per-config failures but never sets a non-zero result, so an all-failure run exits 0. The fix calls the shared setCommandExitCode(1) only when every config has zero completed runs, and it does so before either output branch, so the JSON report and human table are still printed. Keying on runs.length instead of avgTime is the right call, because avgTime drops 0 ms runs and would wrongly fail a sub-millisecond success; the test pins that case. The tests mock the producer and go through runCommand and consumeCommandResult, covering both output modes, 1 and 2 runs per config, partial success, and full success. Need: yes · Size: ok · Reuse: uses the existing commandResult API · Simpler: already minimal.
— Rames
What
Return exit code 1 when
hyperframes benchmarkcompletes no renders across all configurations and attempts.Why
With a corrupt local audio source, every preset fails during render preparation. The command reports five failures and no runs, but exits 0, so automation treats the unusable benchmark as successful.
Related work
Self-contained CLI diagnostic correction; no matching benchmark exit-status issue or overlapping implementation found in current source and PR searches. Existing worker-budget and AWS planning work does not change benchmark command results.
How
Record a failure through the shared command-result API after all configurations finish and before either output branch. The existing JSON report and human table remain available. A completed render still makes the benchmark successful, including partial failures and sub-millisecond runs.
Test plan
To reproduce, put a corrupt local WAV in an otherwise valid composition and run
hyperframes benchmark <project> --runs 1 --json. Every result hasfailures: 1andruns: []; this change also makes the process exit 1.