Scope
Port the Bun/Node HTTP lifecycle semantics needed by these unchanged copied corpus tests:
test/js/node/test/parallel/test-http-request-proxy-post.mjstest/js/node/test/parallel/test-http-request-proxy-post-server-failure.mjs
The shared ESM import lowering landed in b49ba22d0, and Node common.mustCall plus referenced-handle lifecycle enforcement landed in 2edc96ed2. Both files now parse and begin executing in the reduced parity adapter, but nested POST forwarding does not complete.
Current evidence
Use the copied reducer paths, not the source Bun checkout:
zig-out/bin/home-debug test "$PWD/packages/runtime/test/bun-corpus/js/node/test/parallel/test-http-request-proxy-post.mjs"
zig-out/bin/home-debug test "$PWD/packages/runtime/test/bun-corpus/js/node/test/parallel/test-http-request-proxy-post-server-failure.mjs"- The server-failure reproduction entered recursive draining and reached about 3.55 GB RSS in 36 seconds before termination.
- The successful POST path also exceeded a 20-second isolated reducer timeout after lifecycle bookkeeping was enabled.
- Sampling showed repeated JavaScriptCore
VM::drainMicrotasksframes with a deep JavaScript callback chain around URL/domain/HTTP callbacks. - A general experiment that stopped server request chunk delivery after
serverRequest.destroyeddid not resolve the loop and was not retained. - Neighboring unchanged reducer tests complete cleanly, so this is distinct from import syntax or generic callback bookkeeping:
test-http-proxy-request-connection-refused.mjstest-http-proxy-request-max-sockets.mjstest-http-proxy-request-socket-keep-alive.mjstest-http-proxy-request-invalid-url.mjs
Acceptance criteria
- Forward the POST body through the proxy exactly once and deliver the target response to the client.
- Preserve a target reset through the proxy as
ECONNRESET/socket hang up, allowing the proxy to produce its 500 response. - Both
runProxiedPOSTcalls settle with the upstream-observed exit/result contracts. - Both servers and all request/response/socket resources close without recursive microtask growth or leaked event-loop ownership.
- The unchanged upstream assertions, payload, topology, and workload pass; do not weaken fixtures, deadlines, or assertions.
Tracked from #66.