bd6c0b4d3d
Add missing <returns>/<param>/<summary>/<typeparam> tags and clean up misused inheritdoc across 481 files so the documented API surface is complete. Documentation-only (zero code lines changed). The 131 remaining findings are inheritdoc-style warnings deliberately left to preserve hand-written implementation rationale (plan-decision notes, race-condition explanations).
48 lines
1.8 KiB
C#
48 lines
1.8 KiB
C#
using Akka.Cluster;
|
|
using Shouldly;
|
|
using Xunit;
|
|
|
|
namespace ZB.MOM.WW.OtOpcUa.Host.IntegrationTests;
|
|
|
|
/// <summary>
|
|
/// Smoke test: verifies <see cref="TwoNodeClusterHarness"/> boots two nodes and they form
|
|
/// a 2-member cluster with the expected role topology. Failover + deploy scenarios layer
|
|
/// on top in Task 59.
|
|
/// </summary>
|
|
public sealed class ClusterFormationTests
|
|
{
|
|
/// <summary>Verifies that two nodes form a 2-member cluster.</summary>
|
|
/// <returns>A task that represents the asynchronous test operation.</returns>
|
|
[Fact]
|
|
public async Task Two_nodes_form_a_2_member_cluster()
|
|
{
|
|
await using var harness = await TwoNodeClusterHarness.StartAsync();
|
|
|
|
var aCluster = Akka.Cluster.Cluster.Get(harness.NodeASystem);
|
|
var bCluster = Akka.Cluster.Cluster.Get(harness.NodeBSystem);
|
|
|
|
aCluster.State.Members.Count(m => m.Status == MemberStatus.Up).ShouldBe(2);
|
|
bCluster.State.Members.Count(m => m.Status == MemberStatus.Up).ShouldBe(2);
|
|
|
|
var aRoles = aCluster.State.Members.SelectMany(m => m.Roles).Distinct().ToHashSet();
|
|
aRoles.ShouldContain("admin");
|
|
aRoles.ShouldContain("driver");
|
|
}
|
|
|
|
/// <summary>Verifies that both nodes see each other as role members.</summary>
|
|
/// <returns>A task that represents the asynchronous test operation.</returns>
|
|
[Fact]
|
|
public async Task Both_nodes_see_each_other_as_role_members()
|
|
{
|
|
await using var harness = await TwoNodeClusterHarness.StartAsync();
|
|
|
|
var aCluster = Akka.Cluster.Cluster.Get(harness.NodeASystem);
|
|
aCluster.State.Members
|
|
.Where(m => m.Roles.Contains("driver") && m.Status == MemberStatus.Up)
|
|
.Count().ShouldBe(2);
|
|
aCluster.State.Members
|
|
.Where(m => m.Roles.Contains("admin") && m.Status == MemberStatus.Up)
|
|
.Count().ShouldBe(2);
|
|
}
|
|
}
|