Skip to content

Fix race condition in the ListenWithoutBindIsTracked test case - #41352

Draft
Blue (OneBlue) wants to merge 4 commits into
masterfrom
user/oneblue/fix-tests-14
Draft

Fix race condition in the ListenWithoutBindIsTracked test case#41352
Blue (OneBlue) wants to merge 4 commits into
masterfrom
user/oneblue/fix-tests-14

Conversation

@OneBlue

Copy link
Copy Markdown
Collaborator

Summary of the Pull Request

This change solves a race condition in the tests: We're waiting for GNS to perform a port binding, but we're also calling bind() on the same port on the host. If the GNS bind comes right while we hold the bound socket, it will fail and the test will fail.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Copilot AI lite review requested due to automatic review settings August 13, 2026 19:40
@OneBlue
Blue (OneBlue) requested a review from a team as a code owner August 13, 2026 19:40

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.

Pull request overview

This PR updates the VerifyListenWithoutBindIsTracked test logic in the WSL Windows network test suite to eliminate a race between host-side bind() retries and the guest-side implicit port binding/tracking, making the test less flaky while still validating that the listen-without-bind scenario becomes reachable from the host.

Changes:

  • Keep the guest-side listening socket alive across multiple host connection attempts by accepting connections in a loop.
  • Replace the host-side “retry bind until it gets blocked” probe with a “retry connect until it succeeds” probe to avoid competing for the same port.
  • Explicitly target loopback (INADDR_LOOPBACK) for the host connection probe.

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

Copilot AI review requested due to automatic review settings August 13, 2026 23:07
@OneBlue
Blue (OneBlue) marked this pull request as draft August 13, 2026 23:07

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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 14, 2026 16:43

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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 14, 2026 19:39

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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants