Ignore BrokenPipe in the no-network refusal test

Merged
JS
2d ago
+7-2

The ZHTW_NO_NETWORK refusal path exits before reading stdin, so writing the fixture in cli_no_network_env_refuses_verify races the process exit and can fail with a broken pipe (seen on the ubuntu-24.04 job of run 43977152132). The test now ignores the write result and keeps its assertions on exit status and stderr.

Verified locally with make check, plus cargo test --test cli-lint cli_no_network. The race is timing dependent and did not reproduce locally before the fix, so CI is the real confirmation.


Summary by cubic

Fixes a race in cli_no_network_env_refuses_verify where writing the stdin fixture could fail with a broken pipe because the refusal path exits before reading stdin. The test now tolerates BrokenPipe write errors and fails on any other error kind, keeping its assertions on exit status and stderr. No behavior change to zhtw-mcp itself; only the test was updated.