Commit 1a98e43
authored
fix: eliminate broken pipe warnings in benchmark harness (#1148)
## Why
The first CI run of the benchmark harness ([run
23769619685](https://github.com/ambient-code/platform/actions/runs/23769619685))
produced repeated `echo: write error: Broken pipe` warnings on stderr.
While harmless, they clutter CI logs and could mask real errors.
## Summary
- `bench_has_scenario` used process substitution (`<
<(bench_scenarios_for_mode)`) with an early `return 0` on match. When
mode is `both`, the function emits two lines (`cold`, `warm`). If the
first line matches, the reader closes the pipe before the second `echo`
completes, triggering SIGPIPE.
- Fix: capture the output in a variable first
(`scenarios=$(bench_scenarios_for_mode)`), then iterate via here-string
(`<<< "$scenarios"`). Both `echo` calls complete before iteration
begins.
## Test plan
- [x] `shellcheck` clean (same pre-existing false positives only)
- [x] `bash tests/bench-test.sh` passes 8/8
- [ ] CI run produces no broken pipe warnings
Made with [Cursor](https://cursor.com)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Release Notes
This release includes internal refactoring improvements to development
tooling and does not contain any changes visible to end-users.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Robert Gregor <348865+bobbravo2@users.noreply.github.com>1 parent 26687af commit 1a98e43
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
| 437 | + | |
| 438 | + | |
437 | 439 | | |
438 | 440 | | |
439 | 441 | | |
440 | 442 | | |
441 | 443 | | |
442 | 444 | | |
443 | | - | |
| 445 | + | |
444 | 446 | | |
445 | 447 | | |
446 | 448 | | |
| |||
0 commit comments