Repository navigation
test(desktop): two-account callback test uses two distinct ports - #37271
Merged
Merged
Conversation
freePort() closed its probe socket before the next call, so two calls in a row could return the same port and the second listener failed with "port is in use". freePorts(2) holds both probe sockets until both ports are read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — All changes are confined to repository-ignored paths and were assessed on that basis without reconstructing excluded contents. The supplied context identifies no material risk requiring human judgment. Notes:
You can add or adjust custom eligibility rules. Learn more. |
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.
Problem
CodexAuthCallback.test.ts > allows two accounts to complete independentlyfailed in CI on two unrelated branches (#37039, #28839) with "The ChatGPT callback port is in use on this computer". The test calledfreePort()twice in a row.freePort()binds port 0, reads the port, and closes the socket, so the kernel can return the same port on the next call. The second sign-in listener then fails with EADDRINUSE. On Linux, 5 of 20,000 back-to-back bind/close pairs returned the same port.Change
New
freePorts(count)holds every probe socket open until all ports are read, then closes them. The two-account test usesfreePorts(2).freePort()now callsfreePorts(1). Test-only.Scope
CI flake fix, test-only. No issue: the CI runs above show the failure, and the cause is visible in the test helper.
Verification
freePort()forced to return the same port twice: fails 3/3 with the CI error.vp run check:changed: format, lint, knip, typecheck, and test pass.Reviewed with sol-loop: 1 pass with GPT-6.1 Sol. Sol verdict: approved
Made by Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code