Repository navigation
test(claude): end the linger upload pump when the socket closes - #7180
Conversation
Bun drops a TLS write callback still pending when the peer resets the socket. The armed drop resets the uploading client, so a chunk in flight at that moment left the pump unsettled and stop() hung until the 60s test timeout (macos 1/3, run 38699018462). Settle the pump on close as well.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
Maintainer integration into
|
|
✅ Deterministic PR hygiene checks passed. |
Summary
h1 refusal reaches a client that keeps uploading; the drop is armed once with the production budgetintests/claude-integration/claude-picker-linger.test.tstimed out at 60s onmacos 1/3in run 38699018462. It normally passes in 20–80 ms. Over the last 400 Cross-platform CI runs, this is the only failure.The hang is in the test's cleanup. The product behaves correctly. The test's upload pump writes one TLS chunk at a time and settles
pumpedonly from the write callback or from its next tick. When the test fires the armed drop, the picker front destroys the connection and the client getsECONNRESET. Bun drops a TLS write callback that is still pending when the peer resets the socket: a standalone probe on Bun 1.4.3 lost it in 40 of 40 runs. Even a localdestroy()lost it in 1 of 40. If a chunk is in flight at that moment,pumpednever settles, andstop()infinallywaits until Bun's 60s test timeout. A loaded macOS runner is the most likely place to catch a write in flight.The fix settles
pumpedon socketcloseas well. Neither test's assertions or budget change.Verification
stopwith the tracec.end | armed | c.error ECONNRESET | c.close | await stop: 9 of 3,200 finished iterations, and two of the six processes never finished. After the fix, 4,800 of 4,800 passed.--rerun-each 250 --timeout 10000: the unfixed file had 14 timeouts in 1,500 runs of exactly this test name; the fixed file passed 3,000 of 3,000 (both tests).bun run typecheck,bun run test:changed(2 pass).lane=all: linked below once complete.Checklist
Summary by CodeRabbit