Close all four stability-review 2026-04-13 findings so a failed runtime probe subscription can no longer leave a phantom entry that Tick() flips to Stopped and fans out false BadOutOfService quality across a host's subtree, a silently-failed dashboard bind no longer lets the service advertise a successful start while an operator-visible endpoint is dead, the seven sync-over-async sites in LmxNodeManager (rebuild probe sync, Read, Write, four HistoryRead overrides) can no longer park the OPC UA stack thread indefinitely on a hung backend, and alarm auto-subscribe + transferred-subscription restore no longer race shutdown as untracked fire-and-forget tasks.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -96,6 +96,26 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Status
|
||||
response.StatusCode.ShouldBe(HttpStatusCode.MethodNotAllowed);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that Start() returns false and logs a failure when the target port is
|
||||
/// already bound by another listener. Regression guard for the stability-review 2026-04-13
|
||||
/// Finding 2: OpcUaService now surfaces this return value into DashboardStartFailed.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void Start_WhenPortInUse_ReturnsFalse()
|
||||
{
|
||||
var port = new Random().Next(19000, 19500);
|
||||
using var blocker = new HttpListener();
|
||||
blocker.Prefixes.Add($"http://localhost:{port}/");
|
||||
blocker.Start();
|
||||
|
||||
var reportService = new StatusReportService(new HealthCheckService(), 10);
|
||||
reportService.SetComponents(new FakeMxAccessClient(), null, null, null);
|
||||
using var contested = new StatusWebServer(reportService, port);
|
||||
|
||||
contested.Start().ShouldBeFalse();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that cache-control headers disable caching for dashboard responses.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user