Resolve 6 of 7 stability review findings and close test coverage gaps

Fixes P1 StaComThread hang (crash-path faulting via WorkItem queue), P1 subscription
fire-and-forget (block+log or ContinueWith on 5 call sites), P2 continuation point
leak (PurgeExpired on Retrieve/Release), P2 dashboard bind failure (localhost prefix,
bool Start), P3 background loop double-start (task handles + join on stop in 3 files),
and P3 config logging exposure (SqlConnectionStringBuilder password masking). Adds
FakeMxAccessClient fault injection and 12 new tests. Documents required runtime
assemblies in ServiceHosting.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-04-07 15:37:27 -04:00
parent a28600ab1b
commit 95ad9c6866
16 changed files with 692 additions and 52 deletions

View File

@@ -94,6 +94,32 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Historian
mgr.Retrieve(cp).ShouldBeNull();
}
[Fact]
public void Retrieve_ExpiredContinuationPoint_ReturnsNull()
{
var mgr = new HistoryContinuationPointManager(TimeSpan.FromMilliseconds(1));
var values = CreateTestValues(5);
var cp = mgr.Store(values);
System.Threading.Thread.Sleep(50);
mgr.Retrieve(cp).ShouldBeNull();
}
[Fact]
public void Release_PurgesExpiredEntries()
{
var mgr = new HistoryContinuationPointManager(TimeSpan.FromMilliseconds(1));
var cp1 = mgr.Store(CreateTestValues(3));
var cp2 = mgr.Store(CreateTestValues(5));
System.Threading.Thread.Sleep(50);
// Release one — purge should clean both expired entries
mgr.Release(cp1);
mgr.Retrieve(cp2).ShouldBeNull();
}
[Fact]
public void MultipleContinuationPoints_IndependentRetrieval()
{