Files
plugins/packages/window-warmup/tests
yetone 951ac55c94 window-warmup: the fake gateway's reset no longer logs "error: 连接中断" (#902)
The "响应中途连接重置" test's fake gateway broke the connection with
controller.error(new Error("连接中断")) on a served ReadableStream. Bun.serve
prints such a stream error as an unhandled error (its error() callback is
never called), so every green run of the package showed "error: 连接中断"
with a stack, which read as a failing test. It was not the bun version, HOME
or a port: a 20-line probe on bun 1.4.2 printed the same for any
controller.error or throwing pull() in a served stream, with an error()
handler set and seeing nothing.

The reset is now a forced close: the fake records the request, then
server.stop(true) closes the connection before any answer, which the client
sees as ECONNRESET (the same path as before), and nothing is logged. The
truncate case keeps its half body and clean close. Test-only: no version
bump.

Run on mote (bun 1.4.2, HOME=~/runs/home-902):
- origin/main 36141e38, bun test tests/gateway.test.ts, 3 of 3: 63 pass,
  0 fail, one "error: 连接中断" logged each run.
- this commit, same, 3 of 3: 63 pass, 0 fail, nothing logged; whole
  package 279 pass, 1 skip, 0 fail, nothing logged.
- Broken by hand: with the ECONNRESET/EPIPE branch of send() removed, the
  reset test is red (62 pass, 1 fail), so it still reaches that path.
Not run yet: the full root bun test at this commit, queued under
~/suite.lock behind other sessions' suites; its result goes on #902.
2026-11-09 18:54:29 +08:00
..