docs(tests): fix CommentChecker findings across tests/ — 13,392 → 0 (repo-wide scan clean)
Comment/XML-doc changes only: - add summaries to ~10k test methods, fixtures, fakes and helpers (+ <param> on theories, <returns> on async Task methods, <inheritdoc/> on interface implementations the checker can resolve) - strip ~2.6k project-tracking references (WP*, P*-*, row-NN, Task N, #NN, Component-0NN) from comments, keeping the explanatory text; reword false positives in comments only - real docs on fakes implementing BCL/library interfaces (IDisposable, ILogger, IOptionsMonitor, IAsyncLifetime) - reword the last 5 src/ false positives (CWE-1236, failures-1, year-0001, M365) Only non-comment edits: four one-line nested classes split across lines so members can carry docs. Build 0 errors / 0 warnings.
This commit is contained in:
+18
-1
@@ -2,7 +2,7 @@ namespace ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Unit tests for <see cref="ClusterBootstrapGuard"/> — the pure decision core of the
|
||||
/// simultaneous-cold-start split-brain guard (Gitea #33). The runtime probe + JoinSeedNodes wiring
|
||||
/// simultaneous-cold-start split-brain guard. The runtime probe + JoinSeedNodes wiring
|
||||
/// lives in <c>ClusterBootstrapCoordinator</c> and is covered by the real-ActorSystem
|
||||
/// <c>ClusterBootstrapCoordinatorTests</c> in the integration suite.
|
||||
/// </summary>
|
||||
@@ -11,6 +11,7 @@ public class ClusterBootstrapGuardTests
|
||||
private const string A = "akka.tcp://scadabridge@scadabridge-site-a-a:8082";
|
||||
private const string B = "akka.tcp://scadabridge@scadabridge-site-a-b:8082";
|
||||
|
||||
/// <summary>Verifies that the node with the lower address is the founder and needs no probe.</summary>
|
||||
[Fact]
|
||||
public void Lower_address_node_is_the_founder_and_needs_no_probe()
|
||||
{
|
||||
@@ -22,6 +23,7 @@ public class ClusterBootstrapGuardTests
|
||||
Assert.Equal(new[] { A, B }, role.SelfFirstOrder);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the node with the higher address is not the founder and probes its partner.</summary>
|
||||
[Fact]
|
||||
public void Higher_address_node_is_not_the_founder_and_targets_the_partner_for_probing()
|
||||
{
|
||||
@@ -34,6 +36,7 @@ public class ClusterBootstrapGuardTests
|
||||
Assert.Equal(8082, role.PartnerPort);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the founder tie-break gives the same result regardless of seed order.</summary>
|
||||
[Fact]
|
||||
public void Tie_break_is_symmetric_regardless_of_seed_order()
|
||||
{
|
||||
@@ -47,6 +50,7 @@ public class ClusterBootstrapGuardTests
|
||||
Assert.True(onLower.IsFounder ^ onHigher.IsFounder);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the tie-break ignores case, so a casing mismatch cannot make both nodes founders.</summary>
|
||||
[Fact]
|
||||
public void Tie_break_is_case_insensitive_so_a_casing_mismatch_cannot_make_both_founders()
|
||||
{
|
||||
@@ -62,6 +66,7 @@ public class ClusterBootstrapGuardTests
|
||||
Assert.True(onLower.IsFounder); // "site-a-a" < "site-a-b" ordinal-ignore-case
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the higher node joins the founder when the partner is reachable.</summary>
|
||||
[Fact]
|
||||
public void Higher_node_joins_the_founder_when_partner_is_reachable()
|
||||
{
|
||||
@@ -71,6 +76,7 @@ public class ClusterBootstrapGuardTests
|
||||
Assert.Equal(new[] { A, B }, ClusterBootstrapGuard.HigherNodeOrder(role, partnerReachable: true)); // partner (node-a) first
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the higher node forms a cluster alone when the partner is unreachable.</summary>
|
||||
[Fact]
|
||||
public void Higher_node_forms_alone_when_partner_is_unreachable()
|
||||
{
|
||||
@@ -80,6 +86,7 @@ public class ClusterBootstrapGuardTests
|
||||
Assert.Equal(new[] { B, A }, ClusterBootstrapGuard.HigherNodeOrder(role, partnerReachable: false)); // self (node-b) first
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the guard does not apply to a single seed node.</summary>
|
||||
[Fact]
|
||||
public void Guard_does_not_apply_to_a_single_seed_node()
|
||||
{
|
||||
@@ -89,6 +96,7 @@ public class ClusterBootstrapGuardTests
|
||||
Assert.False(role.Applies);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the guard does not apply when the local node is absent from the two seeds.</summary>
|
||||
[Fact]
|
||||
public void Guard_does_not_apply_when_self_is_absent_from_the_two_seeds()
|
||||
{
|
||||
@@ -97,6 +105,7 @@ public class ClusterBootstrapGuardTests
|
||||
Assert.False(role.Applies);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the guard does not apply to three or more seeds.</summary>
|
||||
[Fact]
|
||||
public void Guard_does_not_apply_to_three_or_more_seeds()
|
||||
{
|
||||
@@ -106,6 +115,7 @@ public class ClusterBootstrapGuardTests
|
||||
Assert.False(role.Applies);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the guard does not apply when a seed address is malformed.</summary>
|
||||
[Fact]
|
||||
public void Guard_does_not_apply_when_a_seed_is_malformed()
|
||||
{
|
||||
@@ -114,6 +124,10 @@ public class ClusterBootstrapGuardTests
|
||||
Assert.False(role.Applies);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that parsing a seed address extracts the host and port.</summary>
|
||||
/// <param name="seed">The seed address to parse.</param>
|
||||
/// <param name="expectedHost">The expected host.</param>
|
||||
/// <param name="expectedPort">The expected port.</param>
|
||||
[Theory]
|
||||
[InlineData("akka.tcp://scadabridge@scadabridge-site-a-a:8082", "scadabridge-site-a-a", 8082)]
|
||||
[InlineData("akka.tcp://scadabridge@10.0.0.5:8082/", "10.0.0.5", 8082)]
|
||||
@@ -125,6 +139,8 @@ public class ClusterBootstrapGuardTests
|
||||
Assert.Equal(expectedPort, port);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that parsing rejects malformed seed addresses.</summary>
|
||||
/// <param name="seed">The malformed seed address.</param>
|
||||
[Theory]
|
||||
[InlineData("")]
|
||||
[InlineData("garbage")]
|
||||
@@ -134,6 +150,7 @@ public class ClusterBootstrapGuardTests
|
||||
Assert.False(ClusterBootstrapGuard.TryParse(seed, out _, out _));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the port decides the tie-break when the hosts are equal.</summary>
|
||||
[Fact]
|
||||
public void Port_participates_in_the_tie_break_when_hosts_are_equal()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user