Skip to content

ci: Re-enable ConnectSingleClient_Hostname test#3950

Open
michalChrobot wants to merge 3 commits intodevelop-2.0.0from
fix-mtt-14757
Open

ci: Re-enable ConnectSingleClient_Hostname test#3950
michalChrobot wants to merge 3 commits intodevelop-2.0.0from
fix-mtt-14757

Conversation

@michalChrobot
Copy link
Copy Markdown
Member

@michalChrobot michalChrobot commented Apr 23, 2026

Purpose of this PR

This PR aims to re-enable ConnectSingleClient_Hostname test for Android platform

Why the test was failing

The test's strategy was: start the client connecting to "localhost", wait one frame, look at GetLocalEndpoint() to see which address family was resolved, then start the server on the matching loopback address (127.0.0.1 for IPv4, ::1 for IPv6).

This strategy breaks on Android with Unity 6000.3+ because localhost is no longer guaranteed to resolve to a loopback address (see HOSTNAME_RESOLUTION_AVAILABLE define usage. This test is passing on previous editors as it's compiled out)

Solution

  1. Poll for resolution completion instead of waiting one frame
    GetLocalEndpoint() returns an invalid endpoint until the hostname resolution job runs and the driver binds. One frame was assumed to always be enough, but it seems to not be reliable on all platforms. The fix loops until a valid family is returned, with a 2-second safety timeout.

  2. Listen on the wildcard address instead of a hardcoded loopback
    Rather than mapping the resolved family to a specific loopback address (127.0.0.1 / ::1), the server now listens on the wildcard for that family. This means the server accepts connections on any interface of the correct family, regardless of what IP localhost actually resolved to on the device.

Jira ticket

https://jira.unity3d.com/browse/MTT-14757

Documentation

N/A

Testing & QA (How your changes can be verified during release Playtest)

Green pass of this test of jobs like

  • Run testproject Tests - [android, 6000.3, il2cpp]
  • Run testproject Tests - [android, 6000.4, il2cpp]
  • etc

Backports

N/A, issue related only to NGOv2.X as 1.X doesn't support editors of 6000.3+ (which are affected)

@michalChrobot michalChrobot self-assigned this Apr 23, 2026
@michalChrobot michalChrobot marked this pull request as ready for review April 24, 2026 11:37
@michalChrobot michalChrobot requested a review from a team as a code owner April 24, 2026 11:37
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.

1 participant