fix(host): dev site seed no longer targets the metrics port; validator rejects seed-vs-MetricsPort
This commit is contained in:
@@ -319,6 +319,36 @@ public class StartupValidatorTests
|
||||
Assert.Contains("must not target the gRPC port", ex.Message);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Site_SeedNodeOnMetricsPort_FailsValidation()
|
||||
{
|
||||
// Review 01 [Medium]: appsettings.Site.json shipped a seed pointing at the
|
||||
// Kestrel HTTP/1.1 metrics listener (8084) — a doomed Akka.Remote
|
||||
// association. The validator guarded GrpcPort but not MetricsPort.
|
||||
var values = ValidSiteConfig();
|
||||
values["ScadaBridge:Node:GrpcPort"] = "8083";
|
||||
values["ScadaBridge:Node:MetricsPort"] = "8084";
|
||||
values["ScadaBridge:Cluster:SeedNodes:1"] = "akka.tcp://scadabridge@site-a-node1:8084";
|
||||
var config = BuildConfig(values);
|
||||
|
||||
var ex = Assert.Throws<InvalidOperationException>(() => StartupValidator.Validate(config));
|
||||
Assert.Contains("must not target the metrics port", ex.Message);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Site_SeedNodeOnDefaultMetricsPort_FailsValidation()
|
||||
{
|
||||
// MetricsPort absent => NodeOptions default 8084. A seed on 8084 must
|
||||
// still be rejected. Keep GrpcPort distinct so only the metrics rule fires.
|
||||
var values = ValidSiteConfig();
|
||||
values["ScadaBridge:Node:GrpcPort"] = "8083";
|
||||
values["ScadaBridge:Cluster:SeedNodes:1"] = "akka.tcp://scadabridge@site-a-node2:8084";
|
||||
var config = BuildConfig(values);
|
||||
|
||||
var ex = Assert.Throws<InvalidOperationException>(() => StartupValidator.Validate(config));
|
||||
Assert.Contains("must not target the metrics port", ex.Message);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Site_SeedNodeOnDefaultGrpcPort_FailsValidation()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user