fix: filter broken pipe errors from pipeline-with-failures test. posix-coverage 271.2 [skip-pty]
- SHA
a51cc75e155424d6316e744a8ca99c337c185832- Parents
-
2d9f611 - Tree
4702691
a51cc75
a51cc75e155424d6316e744a8ca99c337c1858322d9f611
4702691| Status | File | + | - |
|---|---|---|---|
| M |
tests/posix_compliance_coverage.sh
|
6 | 1 |
tests/posix_compliance_coverage.shmodified@@ -333,7 +333,12 @@ compare_posix_output "pipeline with :" ': | echo piped' | ||
| 333 | 333 | section "271. PIPELINE - LONG CHAINS" |
| 334 | 334 | |
| 335 | 335 | compare_posix_output "5-stage pipeline" 'echo test | cat | cat | cat | cat | cat' |
| 336 | -compare_posix_output "pipeline with failures" 'echo ok | false | cat; echo $?' | |
| 336 | +# Pipeline timing can produce non-deterministic pipe errors — filter them out | |
| 337 | +TEST_NUM=$((TEST_NUM + 1)) | |
| 338 | +_pf_expected=$(FORTSH_RC_FILE=/dev/null "$BASH_REF" -c 'echo ok | false | cat; echo $?' 2>&1 | grep -v 'Broken pipe' | normalize_output) | |
| 339 | +_pf_actual=$(FORTSH_RC_FILE=/dev/null "$FORTSH_BIN" -c 'echo ok | false | cat; echo $?' 2>&1 | grep -v 'Broken pipe' | normalize_output) | |
| 340 | +if [ "$_pf_expected" = "$_pf_actual" ]; then pass "pipeline with failures" | |
| 341 | +else fail "pipeline with failures" "$_pf_expected" "$_pf_actual"; fi | |
| 337 | 342 | |
| 338 | 343 | # ===================================== |
| 339 | 344 | # ALIAS EDGE CASES |