Cause: "a stream that breaks off" errored the fake's response body with
ctl.error(new Error("connection reset")). Bun prints a response body's
error on every run, even with an error handler on the server, so every
run of the file printed "error: connection reset" at that line while the
test passed. #268 read that print as a red. It was never a failure: 40
of 40 printed it and passed under load on origin/main.
The fake now stops its server mid-body, a real broken connection: the
plugin still ends with Trae CN's error and [DONE], and nothing is printed.
Run on macOS arm64, bun 1.4.2:
- origin/main: 8 parallel `bun test --rerun-each 40 -t "breaks off"`:
every run printed the error, 0 fail.
- This change: 6 parallel `bun test --rerun-each 30
packages/trae/stream.test.mjs` at load average ~55: 6 x 420 pass,
0 fail, 0 printed.
- `HOME=$(mktemp -d) bun test` from the root: 1920 pass, 0 fail.
`bun scripts/check.mjs`: ok.
Test-only, no version bump.