4.6 KiB
CI3 Runtime rebuild idempotence assertion investigation
Base: 04d5513af2620f277a56acbb19ae466623fc054f (SDK2, actual HG1.0), branch codex/opcua2-rebuild-test-barrier. SDK 10.0.403. No production edits, budget changes, expected result changes, skips, or issue actions.
Cause and classification evidence
RecordingSink.EnsureFolder queues EF:eq-1 before the actor finishes materialisation and calls AnnounceAddedNodes, which queues NA:line-1. The old test waited only for EF, captured a possibly incomplete first-call count, then slept after sending the second request. Thus it could attribute the first apply's trailing announcement to the second apply. FinishRebuild sends the public RebuildCompleted outcome after CompleteAddressSpaceApply and deferred writes, so it supplies the needed completion barrier.
An independent source comparison against landed SDK1.5 master 230cef4e found no actor/test changes: git diff 230cef4e 04d5513a -- src/Server/ZB.MOM.WW.OtOpcUa.Runtime/OpcUa/OpcUaPublishActor.cs tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/OpcUa/OpcUaPublishActorRebuildTests.cs has zero bytes (master-candidate-source.diff). This supports a preexisting test-ordering failure, not an SDK2 production idempotence regression.
Controlled reproduction
Temporary test-only AfterEnsureFolder gate blocked the first apply immediately after EF was recorded. The original EF-presence wait and snapshot therefore captured exactly one call. The second request was queued, the gate released, and both apply-completion counters awaited before the unchanged count assertion. The exact CI failure reproduced: expected 1, actual 2. Diagnostic records completed calls=EF:eq-1,NA:line-1; completions=2. There was only one EF and one announcement: no repeated materialisation.
- RED:
controlled-red/controlled-red-diagnostic.trx,test-diagnostic.log,controlled-red-source.cs; build exit0, test exit1, guard exit0; 1 failed/0 passed/0 skipped (expected reproduction). - GREEN: same first-apply gate with explicit count1 while blocked; release, then await first correlated clean
RebuildCompletedbefore snapshot and second correlated clean reply before assertion.controlled-green/controlled-green.trx,controlled-green-source.cs; build0/test0/guard0; 1 passed/0 failed/0 skipped. - Temporary gates are absent from final source. Only the target test changes: both requests ask for outcomes, both replies must match correlation and be clean, original EF/no-full-rebuild/unchanged-call-count assertions remain, and fixed sleep is removed. Existing
PresenceBudgetand cancellation token are retained.
Reproduction commands
From the owned worktree, test project is tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj.
dotnet build "$PROJECT" -c Release --no-restore
dotnet test "$PROJECT" -c Release --no-build --no-restore --filter 'FullyQualifiedName~Second_rebuild_with_same_artifact_is_empty_plan_no_op' --logger 'trx;LogFileName=focused.trx' --results-directory "$RESULTS"
# Preserve dotnet exit before guard; guard does not replace test status.
MIN_EXECUTED=1 bash scripts/ci/assert-not-all-skipped.sh "$RESULTS/focused.trx"
# Owning suite omits --filter and uses its own fresh results directory/TRX.
Final validation
Commit: b5f51406ffc7dcf5b40baa52156ea85e862ab5b4 (one test file; worktree clean).
Final owning project build: exit0, 0 warnings, 0 errors, 2.97s (final/build.log, final/build-status.txt). Full unfiltered Runtime suite: 1,005 total, 1,002 passed, 0 failed, 3 existing skips, duration1m25s. Test exit0, nonzero execution guard exit0 (final/runtime-final.trx, final/test.log, final/guard.log, final/status.txt). Target test is passed in that full-suite TRX. DLL SHA256 is recorded in final/runtime-dll.sha256.
The three existing skips are the retired-v3 artifact/composer parity tests Composer_and_artifact_agree_on_equipment_node_device_host, ParseComposition_scoped_flags_cross_cluster_orphan_equipment, and Driverbound_equipment_kept_when_driver_in_cluster. No skips were added or changed. No remaining diagnostics from this work.
Host concurrently ran coordinator validation; this task makes no performance claim. Root owns broader CI/fixture classification and issue writes.
Coordinator landing: master 52d1373e, merged into SDK2 at 75057d8c; #805 closed after independent SDK1.5 master Runtime validation:1,002passed/0failed/3existing skips, test/guard exits0. No product source changed. Fresh full CI4 follows this repair and fixture correction; it is not assumed green from the owning-suite pass.