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.

Arm history withdrawal fixtures after initial publication

pulse-triage[bot]76b508814417
diff --git a/internal/api/metric_history_authority_test.go b/internal/api/metric_history_authority_test.go
index cf1c56ad73..80522caf8c 100644
--- a/internal/api/metric_history_authority_test.go
+++ b/internal/api/metric_history_authority_test.go
@@ -31,10 +31,11 @@ type metricAuthorityProvider struct {
release chan struct{}
once sync.Once
calls atomic.Int32
+ armed atomic.Bool
}
func (p *metricAuthorityProvider) GetAll() []unified.Resource {
- if p.calls.Add(1) <= 2 {
+ if p.armed.Load() && p.calls.Add(1) <= 2 {
p.entered <- struct{}{}
<-p.release
}
@@ -79,6 +80,9 @@ func newMetricAuthorityFixture(t *testing.T, entry string, scopes []string) *met
router := NewRouter(cfg, nil, nil, nil, nil, "test")
router.monitor = monitor
router.resourceHandlers.SetStateProvider(p)
+ // SetResourceStore publishes an initial view synchronously. Only later
+ // request-owned lookups belong to the withdrawal experiment.
+ p.armed.Store(true)
t.Cleanup(router.ShutdownResourceStores)
path := "/api/metrics-store/history"
q := url.Values{"resourceType": {"disk"}, "resourceId": {metricAuthorityID}, "metric": {"smart_temp"}, "range": {"1h"}}