From eb0783ff2412111132ccbc8577fa58a11ad05c49 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Tue, 20 Jun 2023 14:03:56 +0100 Subject: [PATCH] chore(cli): do not assert non-zero host cpu usage (#8097) --- cli/clistat/stat_internal_test.go | 2 +- cli/stat_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/clistat/stat_internal_test.go b/cli/clistat/stat_internal_test.go index 0cfdc26f7a..5433db0135 100644 --- a/cli/clistat/stat_internal_test.go +++ b/cli/clistat/stat_internal_test.go @@ -69,7 +69,7 @@ func TestStatter(t *testing.T) { t.Parallel() cpu, err := s.HostCPU() require.NoError(t, err) - assert.NotZero(t, cpu.Used) + // assert.NotZero(t, cpu.Used) // HostCPU can sometimes be zero. assert.NotZero(t, cpu.Total) assert.Equal(t, "cores", cpu.Unit) }) diff --git a/cli/stat_test.go b/cli/stat_test.go index b59ea14c29..f955ccdb60 100644 --- a/cli/stat_test.go +++ b/cli/stat_test.go @@ -97,7 +97,7 @@ func TestStatCPUCmd(t *testing.T) { s := buf.String() tmp := clistat.Result{} require.NoError(t, json.NewDecoder(strings.NewReader(s)).Decode(&tmp)) - require.NotZero(t, tmp.Used) + // require.NotZero(t, tmp.Used) // Host CPU can sometimes be zero. require.NotNil(t, tmp.Total) require.NotZero(t, *tmp.Total) require.Equal(t, "cores", tmp.Unit)