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.

Close the harness command client before Windows removes its state dir

rcourtmand52131e0d1c3
diff --git a/internal/hostagent/command_client_test.go b/internal/hostagent/command_client_test.go
index e7934b327c..8f02f50bb7 100644
--- a/internal/hostagent/command_client_test.go
+++ b/internal/hostagent/command_client_test.go
@@ -601,6 +601,10 @@ func newCommandIdentityHarness(t *testing.T, presentedID string, interval time.D
agent.httpClient = h.server.Client()
agent.trimmedPulseURL = h.server.URL
h.agent = agent
+ // Run closes the command client on exit, but several tests never call
+ // run. Close it here, before the state TempDir is removed: Windows cannot
+ // delete the open operation-receipts.db.
+ t.Cleanup(func() { agent.stopCommandClient(true) })
return h
}