Skip to content

Commit eb0783f

Browse files
authored
chore(cli): do not assert non-zero host cpu usage (#8097)
1 parent 0f754f0 commit eb0783f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cli/clistat/stat_internal_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func TestStatter(t *testing.T) {
6969
t.Parallel()
7070
cpu, err := s.HostCPU()
7171
require.NoError(t, err)
72-
assert.NotZero(t, cpu.Used)
72+
// assert.NotZero(t, cpu.Used) // HostCPU can sometimes be zero.
7373
assert.NotZero(t, cpu.Total)
7474
assert.Equal(t, "cores", cpu.Unit)
7575
})

cli/stat_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func TestStatCPUCmd(t *testing.T) {
9797
s := buf.String()
9898
tmp := clistat.Result{}
9999
require.NoError(t, json.NewDecoder(strings.NewReader(s)).Decode(&tmp))
100-
require.NotZero(t, tmp.Used)
100+
// require.NotZero(t, tmp.Used) // Host CPU can sometimes be zero.
101101
require.NotNil(t, tmp.Total)
102102
require.NotZero(t, *tmp.Total)
103103
require.Equal(t, "cores", tmp.Unit)

0 commit comments

Comments
 (0)