test(virtualtags): diagnostic messages on the tick-coalescing assertions (intermittent full-suite failure)
This commit is contained in:
+4
-2
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user