fix(site-runtime): resolve SiteRuntime-001/002/003 — route data-sourced writes to DCL, real per-attribute API results, race-free redeploy

This commit is contained in:
Joseph Doherty
2026-05-16 19:57:28 -04:00
parent 1ae11d1135
commit 09b4bd5dfa
9 changed files with 575 additions and 52 deletions

View File

@@ -113,11 +113,11 @@ public class InstanceActorTests : TestKit, IDisposable
var actor = CreateInstanceActor("Pump1", config);
// SetStaticAttributeCommand is fire-and-forget (no reply); the
// GetAttributeRequest round-trip below confirms it was applied — the
// actor mailbox is FIFO, so the set is processed before the get.
// A static attribute write replies with SetStaticAttributeResponse.
actor.Tell(new SetStaticAttributeCommand(
"corr-3", "Pump1", "Temperature", "100.0", DateTimeOffset.UtcNow));
var setResponse = ExpectMsg<SetStaticAttributeResponse>();
Assert.True(setResponse.Success);
// Verify the value changed in memory
actor.Tell(new GetAttributeRequest(
@@ -145,12 +145,9 @@ public class InstanceActorTests : TestKit, IDisposable
actor.Tell(new SetStaticAttributeCommand(
"corr-persist", "PumpPersist1", "Temperature", "100.0", DateTimeOffset.UtcNow));
// SetStaticAttributeCommand is fire-and-forget; round-trip a
// GetAttributeRequest to confirm the command was processed (FIFO
// mailbox), then wait for the async SQLite persist to complete.
actor.Tell(new GetAttributeRequest(
"corr-persist-get", "PumpPersist1", "Temperature", DateTimeOffset.UtcNow));
ExpectMsg<GetAttributeResponse>(TimeSpan.FromSeconds(5));
// A static attribute write replies with SetStaticAttributeResponse once the
// in-memory state is updated; then wait for the async SQLite persist.
ExpectMsg<SetStaticAttributeResponse>(TimeSpan.FromSeconds(5));
await Task.Delay(500);
// Verify it persisted to SQLite