test(site-runtime): harden scheduler OldestBusyAge gauge assertion — assert non-null, not strictly-positive (TickCount64 ~15ms granularity flakes under load)

This commit is contained in:
Joseph Doherty
2026-07-09 00:33:40 -04:00
parent 9343b4f30f
commit db5ad02cc9
@@ -60,7 +60,10 @@ public class ScriptExecutionSchedulerTests
await WaitUntilAsync(() => scheduler.BusyThreadCount == 1);
Assert.Equal(1, scheduler.QueueDepth); // second task waiting
Assert.True(scheduler.OldestBusyAge > TimeSpan.Zero);
// A busy thread reports a non-null age. Not asserting a strictly-positive
// value: Environment.TickCount64 has ~15 ms granularity, so under load the
// busy-timestamp and this read can fall in the same tick (age == Zero).
Assert.NotNull(scheduler.OldestBusyAge);
gate.Set();
await Task.WhenAll(blocking, queued);