This is an automated email from the ASF dual-hosted git repository.
vldpyatkov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new 24cbe668764 IGNITE-29283 Fix loopback-only assertion in
ClientClusterDiscoveryTestsNoLocalhost (#13820)
24cbe668764 is described below
commit 24cbe668764d3ed30e224265470d8d32f6aaff6d
Author: Vladislav Pyatkov <[email protected]>
AuthorDate: Thu Nov 12 12:14:04 2026 +0300
IGNITE-29283 Fix loopback-only assertion in
ClientClusterDiscoveryTestsNoLocalhost (#13820)
---
.../Client/Cluster/ClientClusterDiscoveryTestsBase.cs | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cluster/ClientClusterDiscoveryTestsBase.cs
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cluster/ClientClusterDiscoveryTestsBase.cs
index 349c518f0f5..82809fa9f2e 100644
---
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cluster/ClientClusterDiscoveryTestsBase.cs
+++
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cluster/ClientClusterDiscoveryTestsBase.cs
@@ -20,6 +20,7 @@ namespace Apache.Ignite.Core.Tests.Client.Cluster
using System;
using System.Linq;
using System.Net;
+ using System.Net.NetworkInformation;
using Apache.Ignite.Core.Client;
using NUnit.Framework;
@@ -159,7 +160,19 @@ namespace Apache.Ignite.Core.Tests.Client.Cluster
count, client.GetConnections().Count());
}
- var cluster = Ignition.GetAll().First().GetCluster();
+ var ignite = Ignition.GetAll().First();
+ var cluster = ignite.GetCluster();
+
+ var localIpAddresses = new[] {IPAddress.Loopback,
IPAddress.IPv6Loopback};
+
+ if (string.IsNullOrEmpty(ignite.GetConfiguration().Localhost))
+ {
+ // Discovery can connect through a non-loopback interface when
Localhost is not set.
+ localIpAddresses =
localIpAddresses.Concat(NetworkInterface.GetAllNetworkInterfaces()
+ .SelectMany(n => n.GetIPProperties().UnicastAddresses)
+ .Select(a => a.Address))
+ .ToArray();
+ }
foreach (var connection in client.GetConnections())
{
@@ -177,7 +190,7 @@ namespace Apache.Ignite.Core.Tests.Client.Cluster
CollectionAssert.Contains(ipAddresses, remoteEndPoint.Address);
var localEndPoint = (IPEndPoint) connection.LocalEndPoint;
- CollectionAssert.Contains(new[] {IPAddress.Loopback,
IPAddress.IPv6Loopback}, localEndPoint.Address);
+ CollectionAssert.Contains(localIpAddresses,
localEndPoint.Address);
}
}
}