4.2 KiB
OT-13 shared probe lifecycle boundary
Scoped changes: six existing address-picker bodies (AbCip, TwinCAT, FOCAS, Galaxy, OpcUaClient, Sql), DriverTestConnectButton, and the new SharedProbeLifecycleTests. No endpoint, authorization policy, credential/audit service, browser backend, transport, package or driver behavior was changed.
The six Open entry points now reject disposed or already-opening instances before reading caller config, and recheck disposal after that synchronous caller-owned accessor before dispatch. Initialization returns after delayed authentication/authorization if the picker was disposed, preventing new CanBrowse construction or value callbacks. Open's final rendering is guarded after disposal. Existing BrowseOpenGuard orphan closure remains exactly in place: a previously dispatched successful open still closes the token that finishes after disposal.
Test Connect similarly rejects busy/disposed entry and disposal during its caller-owned config accessor. An already dispatched operation still finishes through AdminProbeService, including its existing audit behavior, but does not publish a result into a disposed component. Timer scheduling/disposal, probe budgets and exception handling remain owned by their existing implementations.
Red and green evidence
Tests attach actual Razor component instances to the same minimal framework renderer pattern used by existing BrowseOpenGuardTests, invoking their real lifecycle and event entry methods. These are direct framework lifecycle/event-method invocations on attached instances, not DOM clicks or retained render-event delegates, and do not claim browser keyboard behavior. No production test seam or global analyzer suppression was added. The local BL0006 suppression is confined to this renderer test file, matching the established neighboring test pattern.
red.trx: initial 25 cases; 19 failed, six passed (existing orphan cleanup positive controls).red-complete.trx: 32 cases; 26 failed, six passed after adding disposal-during-accessor probes. Failures reproduce duplicate browse/probe dispatch, delayed authentication/authorization continuing after disposal, and caller-accessor disposal still dispatching.green.trx: all 61 combined cases passed, zero skipped/failed: 32 new behavioral cases plus unchanged BrowseOpenGuardTests and TestConnectBudgetTests.shared-regression.trx: broader Pickers/Drivers/new lifecycle slice: 184 passed, zero skipped/failed.
The first initial-harness-wait.log was interrupted: the test incorrectly awaited a second pending operation before releasing the fake completion. It is retained as a harness correction, not behavioral-red evidence. The corrected tests inspect dispatch counts while pending, then release and await tasks. All fake configurations are empty synthetic JSON; no real PLC, database, endpoint or credential was used by these component tests.
Every dotnet test invocation ran through infra/tools/ui-consistency/with_private_sql.py, which validates the separately owned loopback SQL container label/port and passes private SA environment values without printing them. The state file was not read or copied into evidence. This safety wrapper is mandatory even for filtered component tests because SQL test discovery can initialize its fixture before filtering.
Reproduce from the OtOpcUa repository root, substituting the current private state path supplied by the fixture owner:
python3 infra/tools/ui-consistency/with_private_sql.py --state "$OT_PRIVATE_SQL_STATE" -- dotnet test tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/ZB.MOM.WW.OtOpcUa.AdminUI.Tests.csproj -c Debug --artifacts-path artifacts/ot13-shared-probes --filter 'FullyQualifiedName~Pickers|FullyQualifiedName~Drivers|FullyQualifiedName~SharedProbeLifecycleTests' --logger 'trx;LogFileName=shared-regression.trx' --results-directory docs/ui-consistency/evidence/ot13-shared-probes
Artifacts stay in the repository-anchored ignored artifacts/ot13-shared-probes directory so source-ancestry checks resolve the real checkout. xUnit 3/bUnit 2.7.2 and package pins remain unchanged. This bounded lifecycle patch has no new visual design; actual chapter-wide browser and full-suite acceptance remain owned by the OT parent gate.