[CI][Xharness] If we are use the tcp tunnel do not try to get IPs. (#11050)

The main reason why we use the Tcp Tunnel is because we do have
networking issues, one of them is related to the DNS server. If we use
the tunnel we have made a choice and we are sure we will not need the
IPs.

This solves a case in which we have a network failure when we try
to retrieve the IP address using the DNS lookup.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
This commit is contained in:
VS MobileTools Engineering Service 2 2021-03-31 15:30:48 -07:00 коммит произвёл GitHub
Родитель 4ba01d16f3
Коммит 2d17be0670
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -242,7 +242,7 @@ namespace Xharness {
if (isSimulator) {
args.Add (new SetAppArgumentArgument ("-hostname:127.0.0.1", true));
args.Add (new SetEnvVariableArgument ("NUNIT_HOSTNAME", "127.0.0.1"));
} else {
} else if (!listenerFactory.UseTunnel) { // if is not simulator AND we are not using the tunnel, if we use the tunnel this is not needed
var ips = new StringBuilder ();
var ipAddresses = System.Net.Dns.GetHostEntry (System.Net.Dns.GetHostName ()).AddressList;
for (int i = 0; i < ipAddresses.Length; i++) {