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.

test(alerts): isolate pending threshold fixtures from persisted state

pulse-triage[bot]bb1d177d8705
diff --git a/internal/alerts/time_threshold_test.go b/internal/alerts/time_threshold_test.go
index 83a182f30d..a79001aff8 100644
--- a/internal/alerts/time_threshold_test.go
+++ b/internal/alerts/time_threshold_test.go
@@ -8,7 +8,8 @@ import (
)
func TestGetTimeThresholdMappings(t *testing.T) {
- manager := NewManager()
+ manager := NewManagerWithDataDir(t.TempDir())
+ t.Cleanup(manager.Stop)
manager.mu.Lock()
manager.config.TimeThresholds = map[string]int{
@@ -42,7 +43,8 @@ func TestGetTimeThresholdMappings(t *testing.T) {
}
func TestGetTimeThresholdMetricOverrides(t *testing.T) {
- manager := NewManager()
+ manager := NewManagerWithDataDir(t.TempDir())
+ t.Cleanup(manager.Stop)
manager.mu.Lock()
manager.config.TimeThresholds = map[string]int{
@@ -139,7 +141,8 @@ func TestCheckMetricNoisyWarningWaitsButCriticalFiresImmediately(t *testing.T) {
}
func TestCheckMetricUsesPendingStartTime(t *testing.T) {
- manager := NewManager()
+ manager := NewManagerWithDataDir(t.TempDir())
+ t.Cleanup(manager.Stop)
manager.mu.Lock()
manager.config.TimeThresholds["guest"] = 2