mirror of
https://github.com/shirou/gopsutil.git
synced 2025-04-26 13:48:59 +08:00
[process]: add FailNow to avoid panic.
This commit is contained in:
parent
1ab11f7afd
commit
1de1357e77
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user