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.

Drop t.Parallel from dismiss/snooze finding tests that race on global session store

rcourtman16963e415c78
diff --git a/internal/api/ai_patrol_handlers_test.go b/internal/api/ai_patrol_handlers_test.go
index 7561963985..41dc597820 100644
--- a/internal/api/ai_patrol_handlers_test.go
+++ b/internal/api/ai_patrol_handlers_test.go
@@ -288,7 +288,10 @@ func TestHandleDismissFinding_MethodNotAllowed(t *testing.T) {
}
func TestHandleDismissFinding_InvalidReason(t *testing.T) {
- t.Parallel()
+ // InitSessionStore mutates a package-global singleton; running parallel
+ // with TestHandleSnoozeFinding_DurationValidation (which also calls it)
+ // races on store shutdown vs in-flight handler requests. Keep this test
+ // serial until the handler stops depending on the global session store.
tmp := t.TempDir()
cfg := &config.Config{DataPath: tmp}
@@ -318,7 +321,9 @@ func TestHandleDismissFinding_InvalidReason(t *testing.T) {
}
func TestHandleSnoozeFinding_DurationValidation(t *testing.T) {
- t.Parallel()
+ // Serial pairing with TestHandleDismissFinding_InvalidReason — see the
+ // note there. InitSessionStore is package-global and races under
+ // t.Parallel() with other tests that touch the session store.
tmp := t.TempDir()
cfg := &config.Config{DataPath: tmp}