test(adminui): review fixes — locked-snapshot assert, stable fake health, InitializeCount property

This commit is contained in:
Joseph Doherty
2026-06-18 09:18:37 -04:00
parent f87ad5ae8f
commit 0414a04892
2 changed files with 11 additions and 6 deletions
@@ -172,7 +172,7 @@ public sealed class DriverReconnectE2eTests
List<DriverHealthChanged> snapshot;
lock (captureLock) snapshot = captured.Where(c => c.DriverInstanceId == DriverId).ToList();
HasReconnectThenHealthy(captured).ShouldBeTrue(
HasReconnectThenHealthy(snapshot).ShouldBeTrue(
"Expected a Reconnecting push followed by a later Healthy push for the deployed driver. " +
$"States seen: [{string.Join(", ", snapshot.Select(c => c.State))}]");
@@ -254,6 +254,8 @@ public sealed class DriverReconnectE2eTests
await db.SaveChangesAsync(Ct);
}
/// <summary>Polls <paramref name="condition"/> every 100 ms until it returns true or
/// <paramref name="timeout"/> elapses (then throws <see cref="TimeoutException"/>).</summary>
private static async Task WaitForAsync(Func<Task<bool>> condition, TimeSpan timeout)
{
var deadline = DateTime.UtcNow + timeout;