Skip to content

[cherry-pick] test: fix resolver tunnel port allocation and bind errors - #337050

Merged
Christof Marti (chrmarti) merged 1 commit into
release/1.139from
cherry-pick/336996
Sep 21, 2026
Merged

Christof Marti (chrmarti) merged 1 commit into
release/1.139from
cherry-pick/336996

Conversation

@vs-code-engineering

Copy link
Copy Markdown
Contributor

Cherry-pick of #336996 from main.

Summary

Narrowed to the test resolver only. The browser-tools HTTP fixture is handled independently by #336988; this PR no longer changes that test.

  • When the requested local port equals the remote port (the test resolver runs both on the same machine), let the OS allocate a free local port instead of assuming remotePort + 1 is available. The adjacent port can be occupied or reserved on Windows, and remote port 65535 would otherwise produce an invalid local port.
  • Reject tunnel creation on a server bind error instead of leaving the promise pending.
  • Preserve explicitly requested distinct local ports and existing privileged-port behavior.

This addresses the resolver failure behind the rollback in #336381. It is not an additional failure established in Azure build 475409, and #336988 does not require this change because it uses the browser remote proxy without explicitly opening a tunnel.

Validation

  • After narrowing: both test extensions compile with zero errors; scoped hygiene (including ESLint) and git diff --check pass.
  • Direct compiled-resolver probes passed: remote port 65535 allocates a valid local port; an occupied explicitly requested local port rejects with EADDRINUSE.
  • The resolver implementation is unchanged from ec5a082570d, validated by Azure build 475477: succeeded, with all Electron and Remote integration jobs passing on Windows x64, Linux x64, and macOS ARM64. That revision still included the now-removed HTTP fixture, which explicitly exercised tunnel creation in remote tests.
  • The scope-only follow-up commit has not been rerun in Azure.

Copilot AI balanced review requested due to automatic review settings September 21, 2026 14:41
@vs-code-engineering vs-code-engineering Bot added the cherry-pick-artifact Auto-generated cherry-pick PR label Sep 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused resolver changes address the reported failures without unresolved issues.

Review effort: Balanced
Findings: None

What changed in this PR

Improves test-resolver tunnel reliability across platforms.

Changes:

  • Lets the OS allocate a port when local and remote ports match.
  • Rejects tunnel creation on bind errors.
File Description
extensions/​vscode-test-resolver/​src/​extension.ts Handles tunnel port allocation and bind failures.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@chrmarti
Christof Marti (chrmarti) merged commit 92e4d1b into release/1.139 Sep 21, 2026
34 checks passed
@chrmarti
Christof Marti (chrmarti) deleted the cherry-pick/336996 branch September 21, 2026 15:23
@vs-code-engineering vs-code-engineering Bot added this to the 1.139.0 milestone Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick-artifact Auto-generated cherry-pick PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants