From cc7155e5e908f7f30df88fe006bcf12e87ba54ed Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Thu, 3 Dec 2026 12:57:35 -0500 Subject: [PATCH] test(virtualtags): diagnostic messages on the tick-coalescing assertions (intermittent full-suite failure) --- .../VirtualTags/VirtualTagActorTimerTests.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/VirtualTags/VirtualTagActorTimerTests.cs b/tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/VirtualTags/VirtualTagActorTimerTests.cs index 243a12e02..eed5469c9 100644 --- a/tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/VirtualTags/VirtualTagActorTimerTests.cs +++ b/tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/VirtualTags/VirtualTagActorTimerTests.cs @@ -56,8 +56,9 @@ public sealed class VirtualTagActorTimerTests : RuntimeActorTestBase parent.ChildActorOf(VirtualTagActor.Props("vt-1", "expr", evaluator: evaluator, timerIntervalMs: 50), TestContext.Current.CancellationToken); AwaitCondition(() => evaluator.Calls == 1, PresenceBudget, TestContext.Current.CancellationToken); + var gated = System.Diagnostics.Stopwatch.StartNew(); Thread.Sleep(600); // ~12 ticks fire while the first run is in flight - evaluator.Calls.ShouldBe(1); + evaluator.Calls.ShouldBe(1, $"no second evaluation may start while the first is in flight (gated {gated.ElapsedMilliseconds} ms)"); var sinceRelease = System.Diagnostics.Stopwatch.StartNew(); evaluator.Release(); @@ -67,7 +68,8 @@ public sealed class VirtualTagActorTimerTests : RuntimeActorTestBase // sleep (more real ticks) does not fail it, while an immediate ~11-run replay still does. Thread.Sleep(30); var realTicks = (int)(sinceRelease.ElapsedMilliseconds / 50) + 1; - evaluator.Calls.ShouldBeLessThanOrEqualTo(2 + realTicks); + evaluator.Calls.ShouldBeLessThanOrEqualTo(2 + realTicks, + $"coalesced: only real ticks may land after the release ({sinceRelease.ElapsedMilliseconds} ms since release)"); } [Fact]