The test's fake server sent one event, waited 30 ms and errored the body.
The plugin reads its first part before it answers. Under the whole repo's
`bun test` that read sometimes started after the reset, and Bun then drops
the event it had already received. The read threw ECONNRESET out of the
plugin's fetch instead of reaching the mid-stream path the test covers
(1259 pass, 1 fail at a6bed5e). The reset now waits until the caller has
read "half", so the plugin has always read it first. Only the test
changed. index.mjs is untouched, so there's no version bump.
Run at a6bed5e + this change, TMPDIR and HOME set to a scratch dir:
- before the change, repo-root `bun test`: 1259 pass, 1 fail (this test).
A 200 ms pause put by hand before the plugin's first read failed it
every time when run alone.
- after: repo-root `bun test` 1259 pass, 0 fail, 1 skip (exit 0);
packages/trae `bun test` 129 pass; stream.test.mjs alone 3/3;
`bun scripts/check.mjs` exit 0.
- with the same 200 ms pause in place: passes.
- broke it by hand: index.mjs ending a broken stream with finish "stop"
and no error turns this test red.
- grep found no other test that resets a body on a timer.
Not tried: CI's Linux runner. CI's publish runs had passed this test so
far (e.g. 38572309548). Their red was the zed and zen-free Trusted
Publisher 404s.