fix(runtime): malformed artifact bytes on boot/restore are no answer (#601); evict telemetry snapshots on driver removal (#609)

Claude-Session: https://claude.ai/code/session_01Ef2ozxS7QPanGT8uoATbTe
This commit is contained in:
Joseph Doherty
2026-10-08 06:53:45 -04:00
parent 3baa332d6b
commit 53247a056a
10 changed files with 162 additions and 6 deletions
@@ -36,6 +36,28 @@ public sealed class TelemetryLocalHubTests
return items;
}
[Fact]
public void Evict_drops_the_instances_Health_and_every_Resilience_snapshot_but_keeps_others()
{
var hub = new TelemetryLocalHub();
hub.Emit(new TelemetryItem.Health(Health("drv-a")));
hub.Emit(new TelemetryItem.Resilience(Resilience("drv-a", "host-1")));
hub.Emit(new TelemetryItem.Resilience(Resilience("drv-a", "host-2")));
hub.Emit(new TelemetryItem.Health(Health("drv-b")));
hub.Emit(new TelemetryItem.Resilience(Resilience("drv-b", "host-1")));
hub.Evict("drv-a");
hub.Evict("never-existed"); // unknown id is a no-op
using var sub = hub.Subscribe(boundedCapacity: 16);
var items = Drain(sub);
// Positive control: drv-b still replays; drv-a does not.
items.Count.ShouldBe(2);
items.OfType<TelemetryItem.Health>().Single().E.DriverInstanceId.ShouldBe("drv-b");
items.OfType<TelemetryItem.Resilience>().Single().E.DriverInstanceId.ShouldBe("drv-b");
}
[Fact]
public void New_subscriber_is_primed_with_cached_Health_snapshot()
{