From 1ac898c382c84a38adf58364bb247dbafb9b6fe0 Mon Sep 17 00:00:00 2001 From: Shireesh Anjal <355479+anjalshireesh@users.noreply.github.com> Date: Thu, 8 Apr 2021 00:44:25 +0530 Subject: [PATCH] Fix net perf spinner not finishing in subnet health (#3676) In case of single server setups, the network performance data is empty. Because of this, the condition that indicates that the network test step is over never evaluates to true and hence the spinner doesn't finish (doesn't show the tickmark indicating the step has completed). While this is a nigligible issue in normal execution of the subnet health command, it has a weird side effect when the `--license` flag is passed. In such cases, the network test spinner finishes _after_ the message about succesful generation of the report is printed. Ensuring that all the spinners are stopped explicitly after the api call returns resolves this issue. --- cmd/admin-subnet-health.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/admin-subnet-health.go b/cmd/admin-subnet-health.go index e8b00172..65d3c47e 100644 --- a/cmd/admin-subnet-health.go +++ b/cmd/admin-subnet-health.go @@ -380,6 +380,12 @@ func fetchServerHealthInfo(ctx *cli.Context, client *madmin.AdminClient) (madmin progress(adminHealthInfo) } + // In case any of the spinners have not stopped yet (can happen in some + // cases e.g. net perf data is empty in case of single server deployment) + // explicitly stop them + _ = admin(true) && cpu(true) && diskHw(true) && osInfo(true) && + mem(true) && process(true) && config(true) && drive(true) && net(true) + // cancel the context if obdChan has returned. cancel() return healthInfo, err