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 actual poll cycle start in filesystem history tests

rcourtman73225a2fd837
diff --git a/internal/monitoring/guest_filesystem_completeness_test.go b/internal/monitoring/guest_filesystem_completeness_test.go
index d4e53a1aa2..e9170728a9 100644
--- a/internal/monitoring/guest_filesystem_completeness_test.go
+++ b/internal/monitoring/guest_filesystem_completeness_test.go
@@ -117,6 +117,8 @@ func TestVMFilesystemIncompletePollingPreservesHistoryAndBreach(t *testing.T) {
}
build := func() models.VM {
t.Helper()
+ // A slow poll still belongs to the cycle that started before collection.
+ cycleStart := time.Now()
previous := m.previousGuestContextForInstance("partial-filesystems").vmsByID[id]
var vm models.VM
if tc.collector == "node" {
@@ -134,7 +136,7 @@ func TestVMFilesystemIncompletePollingPreservesHistoryAndBreach(t *testing.T) {
m.checkGuestAlertsForVM("partial-filesystems", vm)
}
publish(vm)
- m.recordGuestMetrics([]models.VM{vm}, nil, time.Now().Add(-time.Second))
+ m.recordGuestMetrics([]models.VM{vm}, nil, cycleStart)
view := m.currentModeReadState().VMs()[0]
if view.DiskStatusReason() != vm.DiskStatusReason || view.DiskObservation() != vm.DiskObservation || !reflect.DeepEqual(previousVMFromView(view).Disks, vm.Disks) {
t.Fatalf("canonical projection changed completeness, original age or mount rows: vm=%+v view=%+v", vm, previousVMFromView(view))