diff --git a/tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests/Communication/CentralCommunicationActorTests.cs b/tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests/Communication/CentralCommunicationActorTests.cs index a3df8f20..5556295d 100644 --- a/tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests/Communication/CentralCommunicationActorTests.cs +++ b/tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests/Communication/CentralCommunicationActorTests.cs @@ -735,11 +735,12 @@ public class CentralCommunicationActorTests : ControlPlaneActorTestBase var factory = NewInMemoryDbFactory(); SeedGrpcCluster(factory, "C1", ("host-a:4053", "host-a", 4056, true, false)); var psk = new RecordingPskProvider(); + var clients = new RecordingClientFactory(() => CreateTestProbe()); Sys.ActorOf(CentralCommunicationActor.Props( factory, new MeshTransportOptions { Mode = mode, ContactRefreshSeconds = 60 }, - new RecordingClientFactory(() => CreateTestProbe()), + clients, () => null, new RecordingDialer(), psk)); @@ -748,6 +749,12 @@ public class CentralCommunicationActorTests : ControlPlaneActorTestBase () => psk.KnownClusterPublications.Count >= 1, TimeSpan.FromSeconds(5)); psk.KnownClusterPublications[0].ShouldBe(new[] { "C1" }); psk.InvalidateAllCount.ShouldBeGreaterThanOrEqualTo(1); + + // The one load-bearing line the publication itself cannot witness: with the refresh + // timer now running in every mode, only the ClusterClient branch may construct clients. + // With rows seeded, deleting the !_useClusterClient guard turns this red for Dps/Grpc. + if (mode != MeshTransportOptions.ModeClusterClient) + clients.Calls.ShouldBeEmpty(); } [Fact] diff --git a/tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests/Communication/MeshGrpcCommandDialerTests.cs b/tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests/Communication/MeshGrpcCommandDialerTests.cs index be0896aa..f5fd9776 100644 --- a/tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests/Communication/MeshGrpcCommandDialerTests.cs +++ b/tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests/Communication/MeshGrpcCommandDialerTests.cs @@ -198,7 +198,9 @@ public sealed class MeshGrpcCommandDialerTests // ports on central long before anything else notices. var dialer = new MeshGrpcCommandDialer( new FakePskProvider(("SITE-A", "psk-site-a")), - Options.Create(new MeshTransportOptions { DispatchTimeoutSeconds = 5 }), + // 1 s, not 5: on a host that blackholes loopback instead of refusing, each dial costs + // the full deadline — keep the worst case bounded so this never reads as a hang. + Options.Create(new MeshTransportOptions { DispatchTimeoutSeconds = 1 }), NullLogger.Instance); // Nothing is listening, so both dials fail — irrelevant here: the channel is constructed