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.

Fix TestRestart_StartIfServiceMissing expectation for single config load

rcourtmand4edd1264d7c
diff --git a/internal/api/ai_handler_restart_test.go b/internal/api/ai_handler_restart_test.go
index 87ec491aa8..9d2f58eec8 100644
--- a/internal/api/ai_handler_restart_test.go
+++ b/internal/api/ai_handler_restart_test.go
@@ -70,7 +70,9 @@ func TestRestart_StartIfServiceMissing(t *testing.T) {
})
aiCfg := &config.AIConfig{Enabled: true}
- mockPersist.On("LoadAIConfig").Return(aiCfg, nil).Twice()
+ // Restart loads the config once and passes it to startWithConfig, so the
+ // start path no longer re-loads it (the point of the fix). One load total.
+ mockPersist.On("LoadAIConfig").Return(aiCfg, nil).Once()
mockSvc.On("Start", mock.Anything).Return(nil)
err := h.Restart(context.Background())