fix(hosts): driver health is per (driver, node) — ReportingNodeId on DriverHealthChanged + telemetry proto (#847)
This commit is contained in:
@@ -356,4 +356,35 @@ public sealed class HostsDriverViewTests
|
||||
row.HasSkippedTags.ShouldBeFalse();
|
||||
row.SkippedTagsTitle().ShouldBeEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_driver_reported_by_two_nodes_yields_one_row_per_node_847()
|
||||
{
|
||||
// lmxopcua#847: both nodes of a redundant pair run the same driver; keyed by driver id alone the row
|
||||
// flipped between central-1's Faulted and central-2's Healthy on every publish.
|
||||
var snaps = new[]
|
||||
{
|
||||
new DriverHealthChanged("c", "drv", "Healthy", null, null, 0, When, ReportingNodeId: "central-2"),
|
||||
new DriverHealthChanged("c", "drv", "Faulted", null, "boom", 1, When, ReportingNodeId: "central-1"),
|
||||
};
|
||||
|
||||
var rows = HostsDriverView.Build(snaps, null, [Instance("drv", "c", "Line 1", "Modbus")])
|
||||
.ShouldHaveSingleItem().Drivers;
|
||||
|
||||
rows.Count.ShouldBe(2);
|
||||
rows.Select(r => r.NodeId).ShouldBe(["central-1", "central-2"]);
|
||||
rows.Select(r => r.State).ShouldBe(["Faulted", "Healthy"]);
|
||||
rows.Select(r => r.RowKey).Distinct().Count().ShouldBe(2);
|
||||
rows.ShouldAllBe(r => r.Name == "Line 1");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Hosts_page_renders_a_node_column_and_keys_rows_by_driver_and_node_847()
|
||||
{
|
||||
var src = AdminUiSource.Read("Components", "Pages", "Hosts.razor");
|
||||
src.ShouldContain("@key=\"@($\"row-{d.RowKey}\")\"");
|
||||
src.ShouldNotContain("@key=\"@($\"row-{d.DriverInstanceId}\")\"");
|
||||
src.ShouldContain(">Node</th>");
|
||||
src.ShouldContain("@d.NodeId");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user