Repository navigation
test(desktop): hold early client bytes in the socks5 egress fixture - #7363
Merged
Merged
Conversation
Removing the handshake data listener does not pause a flowing socket, so a TLS ClientHello that arrived before the fixture's upstream connected was dropped and the dial stalled until its 10 s deadline (macOS run 39215956943). Pause until pipe() resumes; add a delayed-upstream regression.
Contributor
|
✅ Deterministic PR hygiene checks passed. |
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. |
Contributor
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 2
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
macos controlon dev ee3ad33 (run 39215956943, job 117939835193) failedverified TLS through authenticated socks5 proxy preserves raw request and responsewith a 10 s timeout (desktop_upstream_connection_failedfromdialDesktopUpstream). The sibling http, https and socks5h cases passed in 11–31 ms.Root cause (test fixture). The socks5 server in
tests/helpers/desktop-egress-fixture.tsanswers CONNECT, callsclient.off("data", onData)and pipesclientto the origin only once its upstreamconnectevent fires. Removing the lastdatalistener does not pause a socket that is already flowing. If the dialer's TLS ClientHello arrives before that loopback connect completes, which happens more often when the runner is loaded, the bytes are emitted with no listener and dropped. The target never answers, and the dial waits out its 10 s deadline. The http and https branches don't have the gap: Node hands their CONNECT socket over without adatalistener, so it stays buffered. The product dialer andsrc/lib/opaque-proxy-tunnel.tsbehave correctly; the other tunnel fixtures already pause or reattach in the same tick.Fix.
client.pause()right after removing the handshake listener;pipe()resumes it.Deterministic regression.
forwardProxyaccepts an optionaltargetConnectDelayMsseam that delays the upstreamconnectcallback, as a loaded event loop does. New cases<kind> fixture proxy keeps early client bytes across a slow upstream connect(http, https, socks5) dial with a 3 s budget.A scratch run with a 50 ms delay and no pause reproduced the CI signature exactly: socks5 and socks5h each failed at 10 007 ms.
History. This was the only failure of this test in the ~25 failed scheduled and dispatched ci.yml runs I checked. A plain stress loop doesn't reproduce it here (0/300 under 8× CPU load), which is why the regression uses the seam.
Verification
bun test tests/lib/optional-desktop-upstream.test.ts: 29 pass, 0 fail.yesCPU load.bun x tsc --noEmitpasses. Test-only change; full suite not run locally.Checklist
Summary by CodeRabbit