diff --git a/cpu/cpu_test.go b/cpu/cpu_test.go index 7de17a7..9695e35 100644 --- a/cpu/cpu_test.go +++ b/cpu/cpu_test.go @@ -82,7 +82,8 @@ func testCPUPercent(t *testing.T, percpu bool) { t.Errorf("error %v", err) } for _, percent := range v { - if percent < 0.0 || percent > 100.0*float64(numcpu) { + // Check for slightly greater then 100% to account for any rounding issues. + if percent < 0.0 || percent > 100.0001*float64(numcpu) { t.Fatalf("CPUPercent value is invalid: %f", percent) } }