diff --git a/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/HandshakeResetEchoTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/HandshakeResetEchoTests.cs index 41110774..d566f725 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/HandshakeResetEchoTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/HandshakeResetEchoTests.cs @@ -84,7 +84,12 @@ public class HandshakeResetEchoTests : TestKit, IDisposable private static IReadOnlyDictionary Values(int batchId) => new Dictionary { ["MoveOutBatchID"] = AttributeValueCodec.Encode(batchId) }; - /// The defect, as documentation: the legacy overload answers from the stale cache. + /// + /// Pins the PERMANENT legacy behaviour, not a bug awaiting a fix: the six-argument overload is + /// deliberately unchanged (deployed scripts keep their semantics) and answers from the stale + /// cache — callers migrate to the reset-aware overload instead. Never "fix" the fast-path in + /// place; delete this test only if the legacy overload itself is removed. + /// [Fact] public async Task LegacyOverload_FastPathsOnThePreviousRunsCachedTrue() { @@ -127,11 +132,13 @@ public class HandshakeResetEchoTests : TestKit, IDisposable // Only now the batch + trigger. var batch = dcl.ExpectMsg(TimeSpan.FromSeconds(5)); Assert.Equal(TriggerTag, batch.TriggerTagPath); + // TriggerValue may arrive boxed as bool or as its already-encoded string; normalise both sides. Assert.Equal(AttributeValueCodec.Encode(true), AttributeValueCodec.Encode(batch.TriggerValue)); Assert.True(batch.Values.ContainsKey(BatchTag)); dcl.Reply(new WriteTagBatchResponse(batch.CorrelationId, true, null, DateTimeOffset.UtcNow)); - // Still pending: the cache now holds False. + // Still pending: the cache now holds False, and nothing can complete the call until the + // TagValueUpdate below is sent — no race here, only a documented intermediate state. Assert.False(call.IsCompleted); // The device completes THIS request.