This is an automated email from the ASF dual-hosted git repository.

ptupitsyn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new 8f62930cd6 IGNITE-19774 .NET: Fix IgniteClientTests.TestToString 
flakiness (#2222)
8f62930cd6 is described below

commit 8f62930cd6c59c2ccd5006492d3e588122a93d9a
Author: Pavel Tupitsyn <[email protected]>
AuthorDate: Tue Jun 20 09:31:23 2023 +0300

    IGNITE-19774 .NET: Fix IgniteClientTests.TestToString flakiness (#2222)
---
 .../dotnet/Apache.Ignite.Tests/IgniteClientTests.cs   | 19 ++++++++++---------
 .../dotnet/Apache.Ignite.Tests/JavaServer.cs          |  2 +-
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/modules/platforms/dotnet/Apache.Ignite.Tests/IgniteClientTests.cs 
b/modules/platforms/dotnet/Apache.Ignite.Tests/IgniteClientTests.cs
index 3db7a71f41..ef8780e4d4 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Tests/IgniteClientTests.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Tests/IgniteClientTests.cs
@@ -17,6 +17,7 @@
 
 namespace Apache.Ignite.Tests
 {
+    using System.Linq;
     using System.Threading.Tasks;
     using NUnit.Framework;
 
@@ -49,17 +50,17 @@ namespace Apache.Ignite.Tests
         [Test]
         public async Task TestToString()
         {
-            var cfg = new IgniteClientConfiguration { Endpoints = { 
"127.0.0.1:" + ServerPort } };
+            var address = "127.0.0.1:" + ServerPort;
+            var cfg = new IgniteClientConfiguration { Endpoints = { address } 
};
             using var client = await IgniteClient.StartAsync(cfg);
+            var id = client.GetConnections().Single().Node.Id;
 
-            // IgniteClientInternal { Connections = [ ClusterNode {
-            // Id = 703cc4d7-41ef-4321-b960-70ad9df2617b,
-            // Name = 
org.apache.ignite.internal.runner.app.PlatformTestNodeRunner,
-            // Address = 127.0.0.1:10942 } ] }
-            StringAssert.StartsWith("IgniteClientInternal { Connections = [ 
ClusterNode { Id = ", client.ToString());
-            StringAssert.Contains(
-                "Name = 
org.apache.ignite.internal.runner.app.PlatformTestNodeRunner, Address = 
127.0.0.1:109",
-                client.ToString());
+            var expected = $"IgniteClientInternal {{ Connections = [ 
ClusterNode {{ " +
+                           $"Id = {id}, " +
+                           $"Name = 
org.apache.ignite.internal.runner.app.PlatformTestNodeRunner, " +
+                           $"Address = {address} }} ] }}";
+
+            Assert.AreEqual(expected, client.ToString());
         }
     }
 }
diff --git a/modules/platforms/dotnet/Apache.Ignite.Tests/JavaServer.cs 
b/modules/platforms/dotnet/Apache.Ignite.Tests/JavaServer.cs
index 16cb79de57..b1f4d97101 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Tests/JavaServer.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Tests/JavaServer.cs
@@ -93,7 +93,7 @@ namespace Apache.Ignite.Tests
 
                 if (line.StartsWith("THIN_CLIENT_PORTS", 
StringComparison.Ordinal))
                 {
-                    ports = 
line.Split('=').Last().Split(',').Select(int.Parse).ToArray();
+                    ports = 
line.Split('=').Last().Split(',').Select(int.Parse).OrderBy(x => x).ToArray();
                     evt.Set();
                 }
             };

Reply via email to