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:
+4
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user