Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGNITE-24228 .NET: Fix flaky tests on Windows #5135

Merged
merged 4 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions modules/platforms/dotnet/Apache.Ignite.Tests/LoggingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace Apache.Ignite.Tests;
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;
Expand Down Expand Up @@ -82,8 +83,17 @@ public async Task TestMicrosoftConsoleLogger()
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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace Apache.Ignite.Tests;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Internal.Common;
using NUnit.Framework;

/// <summary>
Expand All @@ -46,7 +47,11 @@ public async Task TestClientDropsConnectionOnClusterIdMismatch()

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);
}

Expand Down