Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Stabilize mock snapshot memoization proof

pulse-triage[bot]7348c1790504
diff --git a/internal/mock/fixture_data_version_test.go b/internal/mock/fixture_data_version_test.go
index 6d91306b6c..ab468531b7 100644
--- a/internal/mock/fixture_data_version_test.go
+++ b/internal/mock/fixture_data_version_test.go
@@ -32,6 +32,17 @@ func TestFixtureDataVersionAdvancesOnMetricTick(t *testing.T) {
func TestUnifiedResourceSnapshotMemoizedPerDataVersion(t *testing.T) {
withMockEnabledForTest(t)
+ // This test advances the fixture explicitly below. Pause the automatic
+ // metric ticker so a slow race-enabled snapshot build cannot change the
+ // data version between the two reads whose memoization identity we are
+ // asserting.
+ stopUpdateLoop()
+ t.Cleanup(func() {
+ if IsMockEnabled() {
+ startUpdateLoop()
+ }
+ })
+
first, firstFreshness := UnifiedResourceSnapshot()
if len(first) == 0 {
t.Fatal("expected mock resources")