From 864513827467daefdbbc5038ab78e459e285954a Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Sun, 6 Sep 2026 14:23:47 -0400 Subject: [PATCH] test(site-runtime): flush the tracking-store queue before the boundary-timestamp test's direct UPDATE The single-writer queue (d91135f9) made RecordEnqueueAsync return on enqueue, so the test's verifier-connection UPDATE raced the pump and touched zero rows whenever the pump lost. Every other verifier-connection test already flushed; this one was missed. Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29 --- .../Tracking/OperationTrackingStoreTests.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Tracking/OperationTrackingStoreTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Tracking/OperationTrackingStoreTests.cs index 977d6b65..b0ae9b9c 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Tracking/OperationTrackingStoreTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Tracking/OperationTrackingStoreTests.cs @@ -872,6 +872,11 @@ public class OperationTrackingStoreTests : IDisposable kind: nameof(AuditKind.ApiCallCached), targetSummary: "ERP.B", sourceInstanceId: "I", sourceScript: "S", sourceNode: "node-a"); + // Writes are queued (single-writer pump, 2026-09-06): the verifier connection + // below bypasses the store, so drain the queue first or the UPDATE races the + // INSERTs and touches zero rows. + await store.FlushAsync(); + // Force both rows to share one exact UpdatedAtUtc instant, formatted the same // way the read normalises the cursor ('Z'-suffixed round-trip "o"). var boundary = DateTime.UtcNow;