Historian aggregates: PercentGood diverges from the SDK after the 1.5.378.182 bump (10 SdkAggregateParityTests failures) #796
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
SdkAggregateParityTests(tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Historian.Sql.Common.Tests) fails 10 of 275 on master.2da58d03^and fails at2da58d03, the OPC Foundation SDK bump to 1.5.378.182 (#782).EndsInside 0→50/20s [2] ours 75 | sdk 100, and[0] ours 0 | sdk 25.To do: find the SDK change, decide which side Part 13 supports, then either fix our evaluator or set the test's SDK configuration explicitly. Also check whether HistoryRead PercentGood results seen by clients (ScadaBridge) change.
Root cause, found by the investigation I stopped. Not committed.
Opc.Ua.Server 1.5.378.182 changed
StatusAggregateCalculator.ComputeDurationGoodBad. WithTreatUncertainAsBad = falseit now counts Uncertain regions as Good time, and as Bad when the flag is true. 1.5.378.106 and earlier counted Uncertain as neither. Part 13 keeps Uncertain out of both (§5.4.3.31 DurationGood, §5.4.3.33 PercentGood). So does Mantis 0006166 (closed 2022, "Uncertain data does not affect the calculations"): an all-Uncertain interval is PercentGood 0 and PercentBad 0.Our evaluator follows Part 13, so the SDK oracle is what moved. This is not a server bug. PercentBad is unaffected because Bad regions are counted as before.
Proposed fix (test side only): in
tests/Drivers/Historian.Conformance/SdkAggregateOracle.cs, derive the oracle's PercentGood as100 − PercentBad(run with TreatUncertainAsBad = true). Keep aRunSdkAsIspath plus a test that pins the SDK divergence. The work-in-progress patch is below. It is untested. Still to do: add the pinning test, run Sql.Common.Tests and both SQL backends' integration suites (the oracle is source-linked into them), and check that nothing at runtime uses the SDK's PercentGood.