You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2024/12/23 17:30:33 UTC
(ignite-3) branch main updated: IGNITE-23929 .NET: Fix TestHandshakesFailed flakiness (#4957)
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 01b21ce3cd IGNITE-23929 .NET: Fix TestHandshakesFailed flakiness (#4957)
01b21ce3cd is described below
commit 01b21ce3cdf6247106e58eb1bee8629a4046cf0d
Author: Pavel Tupitsyn <pt...@apache.org>
AuthorDate: Mon Dec 23 19:30:28 2024 +0200
IGNITE-23929 .NET: Fix TestHandshakesFailed flakiness (#4957)
---
modules/platforms/dotnet/Apache.Ignite.Tests/IgniteServerBase.cs | 7 +++++--
modules/platforms/dotnet/Apache.Ignite.Tests/MetricsTests.cs | 3 +--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/modules/platforms/dotnet/Apache.Ignite.Tests/IgniteServerBase.cs b/modules/platforms/dotnet/Apache.Ignite.Tests/IgniteServerBase.cs
index de05e6da3e..0c3a80acbb 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Tests/IgniteServerBase.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Tests/IgniteServerBase.cs
@@ -50,7 +50,8 @@ public abstract class IgniteServerBase : IDisposable
_listener.Bind(new IPEndPoint(IPAddress.Any, port));
_listener.Listen(backlog: 1);
- Console.WriteLine($"Fake server started [port={Port}, test={TestContext.CurrentContext.Test.Name}]");
+ Name = TestContext.CurrentContext.Test.Name;
+ Console.WriteLine($"Fake server started [port={Port}, test={Name}]");
Task.Run(ListenLoop);
}
@@ -61,6 +62,8 @@ public abstract class IgniteServerBase : IDisposable
public bool AllowMultipleConnections { get; set; }
+ public string Name { get; set; }
+
public bool DropNewConnections
{
get => _dropNewConnections;
@@ -166,7 +169,7 @@ public abstract class IgniteServerBase : IDisposable
continue;
}
- Console.WriteLine("Error in FakeServer: " + e);
+ Console.WriteLine($"Error in FakeServer [Name={Name}]: {e}");
}
}
}
diff --git a/modules/platforms/dotnet/Apache.Ignite.Tests/MetricsTests.cs b/modules/platforms/dotnet/Apache.Ignite.Tests/MetricsTests.cs
index 171e3daa4b..cada94a17a 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Tests/MetricsTests.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Tests/MetricsTests.cs
@@ -139,7 +139,7 @@ public class MetricsTests
using var server = new FakeServer { SendInvalidMagic = true };
Assert.ThrowsAsync<IgniteClientConnectionException>(async () => await server.ConnectClientAsync(GetConfig()));
- AssertMetric(MetricNames.HandshakesFailed, 1);
+ AssertMetricGreaterOrEqual(MetricNames.HandshakesFailed, 1);
AssertMetric(MetricNames.HandshakesFailedTimeout, 0);
AssertMetric(MetricNames.ConnectionsActive, 0);
@@ -152,7 +152,6 @@ public class MetricsTests
using var server = new FakeServer { HandshakeDelay = TimeSpan.FromSeconds(1) };
Assert.ThrowsAsync<IgniteClientConnectionException>(async () => await server.ConnectClientAsync(GetConfigWithDelay()));
- AssertMetric(MetricNames.HandshakesFailed, 0);
AssertMetric(MetricNames.HandshakesFailedTimeout, 1);
AssertTaggedMetric(MetricNames.HandshakesFailedTimeout, 1, server, null);