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.

Use the stored timestamp contract in the connected History fixture

pulse-triage[bot]df89d68c1358
diff --git a/internal/api/truenas_disk_history_integration_test.go b/internal/api/truenas_disk_history_integration_test.go
index f056278f88..03b7e1c06b 100644
--- a/internal/api/truenas_disk_history_integration_test.go
+++ b/internal/api/truenas_disk_history_integration_test.go
@@ -241,7 +241,10 @@ func TestTrueNASDiskHistoryAuthenticatedRoute(t *testing.T) {
}
t.Cleanup(func() { _ = store.Close() })
setUnexportedField(t, monitor, "metricsStore", store)
- ioTime := time.Now().UTC().Add(-20 * time.Second)
+ // Match the existing persistent-history timestamp precision, as the other
+ // store-backed route fixtures do. Native sample/bucket assertions below
+ // still require the exact independently supplied timestamps.
+ ioTime := time.Now().UTC().Truncate(time.Second).Add(-20 * time.Second)
store.WriteBatchSync([]metrics.WriteMetric{{ResourceType: "disk", ResourceID: "disk-serial", MetricType: "diskread", Tier: metrics.TierRaw, Value: 1024, Timestamp: ioTime}})
all := readAll()
assertNative(all["smart_temp"], 6)