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 65c64c1654d IGNITE-24228 .NET: Fix flaky tests on Windows (#5135)
65c64c1654d is described below

commit 65c64c1654d5d255c2bd86666e8a2b390a95b435
Author: Pavel Tupitsyn <[email protected]>
AuthorDate: Mon Feb 10 09:12:14 2025 +0400

    IGNITE-24228 .NET: Fix flaky tests on Windows (#5135)
---
 .../platforms/dotnet/Apache.Ignite.Tests/LoggingTests.cs   | 14 ++++++++++++--
 .../dotnet/Apache.Ignite.Tests/MultiClusterTest.cs         |  7 ++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/modules/platforms/dotnet/Apache.Ignite.Tests/LoggingTests.cs 
b/modules/platforms/dotnet/Apache.Ignite.Tests/LoggingTests.cs
index e3bf2d17181..1410f4aa7b0 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Tests/LoggingTests.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Tests/LoggingTests.cs
@@ -22,6 +22,7 @@ using System.Diagnostics.CodeAnalysis;
 using System.IO;
 using System.Threading.Tasks;
 using Internal;
+using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Logging.Console;
 using NUnit.Framework;
@@ -82,8 +83,17 @@ public class LoggingTests
             var cfg = new IgniteClientConfiguration
             {
                 LoggerFactory = LoggerFactory.Create(builder =>
-                    builder.AddSimpleConsole(opt => opt.ColorBehavior = 
LoggerColorBehavior.Disabled)
-                        .SetMinimumLevel(LogLevel.Trace))
+                {
+                    builder.AddConsole(opt =>
+                        {
+                            opt.MaxQueueLength = 1;
+                            opt.QueueFullMode = 
ConsoleLoggerQueueFullMode.Wait;
+                            opt.FormatterName = ConsoleFormatterNames.Simple;
+                        })
+                        .SetMinimumLevel(LogLevel.Trace);
+
+                    builder.Services.Configure((SimpleConsoleFormatterOptions 
opts) => opts.ColorBehavior = LoggerColorBehavior.Disabled);
+                })
             };
 
             using var server = new FakeServer();
diff --git a/modules/platforms/dotnet/Apache.Ignite.Tests/MultiClusterTest.cs 
b/modules/platforms/dotnet/Apache.Ignite.Tests/MultiClusterTest.cs
index 3e3a1eb9151..cc1862dd7e1 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Tests/MultiClusterTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Tests/MultiClusterTest.cs
@@ -22,6 +22,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Net;
 using System.Threading.Tasks;
+using Internal.Common;
 using NUnit.Framework;
 
 /// <summary>
@@ -46,7 +47,11 @@ public class MultiClusterTest
 
         using var client = await IgniteClient.StartAsync(cfg);
 
-        TestUtils.WaitForCondition(() => log.Entries.Any(e => 
e.Message.Contains("Cluster ID mismatch")));
+        TestUtils.WaitForCondition(
+            () => log.Entries.Any(e => e.Message.Contains("Cluster ID 
mismatch")),
+            5000,
+            () => log.Entries.StringJoin());
+
         Assert.AreEqual(1, client.GetConnections().Count);
     }
 

Reply via email to