diff --git a/process/process_test.go b/process/process_test.go index c5aac11f6f56bca3482e4a7b68b317834fefb54d..b79354bcfb89a8f96247bda5bb5c48ccfaaec6c8 100644 --- a/process/process_test.go +++ b/process/process_test.go @@ -374,6 +374,9 @@ func Test_CPUTimes(t *testing.T) { cpuTimes1, err := process.CPUTimes() assert.Nil(t, err) + if cpuTimes0 == nil || cpuTimes1 == nil { + t.FailNow() + } measuredElapsed := cpuTimes1.Total() - cpuTimes0.Total() message := fmt.Sprintf("Measured %fs != spun time of %fs\ncpuTimes0=%v\ncpuTimes1=%v", measuredElapsed, spinSeconds, cpuTimes0, cpuTimes1)