test(cluster): add TwoNodeClusterFixture — real two-node in-process cluster rig from production HOCON

This commit is contained in:
Joseph Doherty
2026-07-08 14:58:34 -04:00
parent f91e75bfe4
commit e3a6603c74
2 changed files with 138 additions and 0 deletions
@@ -0,0 +1,18 @@
using Xunit;
namespace ZB.MOM.WW.ScadaBridge.IntegrationTests.Cluster;
public class TwoNodeClusterFixtureTests
{
[Fact]
public async Task Fixture_FormsTwoNodeCluster_NodeAIsOldest()
{
await using var cluster = await TwoNodeClusterFixture.StartAsync();
var a = Akka.Cluster.Cluster.Get(cluster.NodeA);
var b = Akka.Cluster.Cluster.Get(cluster.NodeB);
Assert.Equal(2, a.State.Members.Count);
Assert.Equal(2, b.State.Members.Count);
// NodeA started first => oldest (the singleton host).
Assert.True(a.SelfMember.IsOlderThan(b.State.Members.First(m => m.Address == b.SelfAddress)));
}
}