test(opcua): retain manager references across soak restart

This commit is contained in:
Joseph Doherty
2026-11-10 12:03:52 -05:00
parent 73ee3ef20d
commit a456d598ab
@@ -323,13 +323,15 @@ public sealed class Sdk2LifecycleSoakTests
(await BrowseAsync(client, ct)).IsEmpty.ShouldBeFalse();
(await PageAsync(client, default, false, ct)).ContinuationPoint.IsEmpty.ShouldBeFalse();
var oldInternal = rig.Server.CurrentInstance;
var oldSessions = oldInternal.SessionManager.GetSessions().ToArray();
var oldSubscriptions = oldInternal.SubscriptionManager.GetSubscriptions().ToArray();
var oldSessionManager = oldInternal.SessionManager;
var oldSubscriptionManager = oldInternal.SubscriptionManager;
var oldSessions = oldSessionManager.GetSessions().ToArray();
var oldSubscriptions = oldSubscriptionManager.GetSubscriptions().ToArray();
var oldManager = rig.Server.CertificateManager!;
var oldCores = CertificateCores(oldManager);
await rig.RestartAsync(ct).WaitAsync(TimeSpan.FromSeconds(20), ct);
oldInternal.SessionManager.GetSessions().ShouldBeEmpty();
oldInternal.SubscriptionManager.GetSubscriptions().ShouldBeEmpty();
oldSessionManager.GetSessions().ShouldBeEmpty();
oldSubscriptionManager.GetSubscriptions().ShouldBeEmpty();
oldSubscriptions.ShouldAllBe(item => item.MonitoredItemCount == 0);
foreach (var session in oldSessions) ContinuationCounts(session).ShouldBe((0, 0));
RequiredField<bool>(oldManager, "m_disposed").ShouldBeTrue();