bxctl: chat_approvals' helper accepts a broken pipe on stdin
json_prints_only_json_and_never_asks_brokerd failed once under load: the helper wrote the typed input to a `bxctl chat --json` that never reads stdin and had already exited, and unwrapped the broken pipe. A broken pipe on that write is now accepted; any other error still fails the test, and a test whose input must be read checks the output. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -398,8 +398,15 @@ fn chat(loopd: &Path, brokerd: &Path, extra: &[&str], typed: &str) -> std::proce
|
||||
.spawn()
|
||||
.unwrap();
|
||||
{
|
||||
// A `bxctl` that never reads stdin (with `--json`, or with no approval to answer) may
|
||||
// exit before the write: a broken pipe then is not an error. Anything that must be read
|
||||
// is checked by the test's own assertions on the output.
|
||||
let mut stdin = child.stdin.take().unwrap();
|
||||
stdin.write_all(typed.as_bytes()).unwrap();
|
||||
match stdin.write_all(typed.as_bytes()) {
|
||||
Ok(()) => {}
|
||||
Err(e) if e.kind() == std::io::ErrorKind::BrokenPipe => {}
|
||||
Err(e) => panic!("writing to bxctl's stdin: {e}"),
|
||||
}
|
||||
}
|
||||
child.wait_with_output().unwrap()
|
||||
}
|
||||
|
||||
@@ -104,13 +104,11 @@ The gate count is the passed total of `cargo test --workspace` plus one, for the
|
||||
| 05 | 1403 | 24, 24 |
|
||||
| 06 | 1414 | 22, 22 |
|
||||
|
||||
**Known flaky test** (T52): `bxctl`'s `chat_approvals` test
|
||||
**A flaky test, fixed before the run:** `bxctl`'s `chat_approvals` test
|
||||
`json_prints_only_json_and_never_asks_brokerd` failed once in 5 loaded runs of the whole workspace
|
||||
while task 06 was checked (and 0 in 60 runs of that file alone under load). It writes to the
|
||||
standard input of a `bxctl chat --say` that does not read it and may already have exited, and
|
||||
`write_all` fails with a broken pipe. No task of this plan touches `bxctl`'s chat. A session
|
||||
that sees it fail once, then pass on a rerun and in the gate, names it in its row's Notes and
|
||||
goes on.
|
||||
while task 06 was checked: its helper wrote to the standard input of a `bxctl chat` that does not
|
||||
read it and may already have exited, and unwrapped the broken pipe. The helper now accepts a
|
||||
broken pipe on that write (master, after task 06); 0 failures in 100 loaded runs.
|
||||
|
||||
## Before hand-over
|
||||
|
||||
|
||||
Reference in New Issue
Block a user