From 424963b39d1485b3a56cd5c68cc457e0054a5a5b Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Fri, 4 Dec 2026 17:42:28 -0500 Subject: [PATCH] =?UTF-8?q?test(script-worker):=20#1100=20the=20shadow=20c?= =?UTF-8?q?ensus's=20unsupported-type=20example=20is=20a=20jagged=20array?= =?UTF-8?q?=20=E2=80=94=20a=20decimal=20is=20now=20refused=20by=20both=20r?= =?UTF-8?q?unners=20alike=20and=20matches?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ShadowModeTests counted 'return 1.5m;' as an unsupported_type mismatch (in process Ok decimal, worker 'unsupported type'). Since 9dbccf231 both runners refuse it with the same reason, so it matches; the one result the worker alone still refuses is a jagged array (no nested-array wire tag), which takes its place. --- .../ShadowModeTests.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/Server/ZB.MOM.WW.OtOpcUa.ScriptWorker.Tests/ShadowModeTests.cs b/tests/Server/ZB.MOM.WW.OtOpcUa.ScriptWorker.Tests/ShadowModeTests.cs index b447ad67c..3ac028603 100644 --- a/tests/Server/ZB.MOM.WW.OtOpcUa.ScriptWorker.Tests/ShadowModeTests.cs +++ b/tests/Server/ZB.MOM.WW.OtOpcUa.ScriptWorker.Tests/ShadowModeTests.cs @@ -102,7 +102,10 @@ public sealed class ShadowModeTests ["quality"] = "return ctx.GetTag(\"i\").StatusCode;", ["throws"] = "if ((int)ctx.GetTag(\"i\").Value >= 0) throw new InvalidOperationException(\"boom \" + ctx.GetTag(\"i\").Value); return 0;", ["divergent"] = $"return {InWorker} ? 2 : 1;", + // lmxopcua#1100: a decimal is refused by both runners alike now (no OPC UA node can carry it), so it MATCHES; + // the one result shape left that only the worker refuses is a jagged array (no nested-array wire tag). ["decimal"] = "return 1.5m;", + ["jagged"] = "return new[] { new[] { (int)ctx.GetTag(\"i\").Value } };", }; for (var i = 0; i < 3; i++) @@ -122,12 +125,12 @@ public sealed class ShadowModeTests stats.Compared.ShouldBe(scripts.Count * 3); stats.Mismatched.ShouldBe(6, string.Join(Environment.NewLine, shadow.Mismatches.Select(m => $"{m.Key}: {m.LastReason} — {m.LastSummary}"))); var mismatches = shadow.Mismatches.ToDictionary(m => m.Key); - mismatches.Keys.ShouldBe(["decimal", "divergent"], ignoreOrder: true); + mismatches.Keys.ShouldBe(["jagged", "divergent"], ignoreOrder: true); mismatches["divergent"].LastReason.ShouldBe("value"); mismatches["divergent"].LastSummary.ShouldBe("published Ok Int32 1; shadow Ok Int32 2"); mismatches["divergent"].Count.ShouldBe(3); - mismatches["decimal"].LastReason.ShouldBe("unsupported_type"); - mismatches["decimal"].LastSummary.ShouldContain("System.Decimal"); + mismatches["jagged"].LastReason.ShouldBe("unsupported_type"); + mismatches["jagged"].LastSummary.ShouldContain("System.Int32[][]"); var lines = log.Events.Where(e => e.MessageTemplate.Text.StartsWith("Script shadow mismatch", StringComparison.Ordinal)).ToArray(); lines.Length.ShouldBe(2, "one line per script and reason");