Expect user + cpu to be within 500ms of total.

This should be a sane default.
This commit is contained in:
Victor Marmol 2015-01-27 13:51:32 -08:00
parent 5851645aa6
commit 593d546946

View File

@ -46,7 +46,7 @@ func checkCpuStats(t *testing.T, stat info.CpuStats) {
totalUsage += usage
}
inDelta(t, stat.Usage.Total, totalUsage, uint64((5 * time.Millisecond).Nanoseconds()), "Per-core CPU usage")
inDelta(t, stat.Usage.Total, stat.Usage.User+stat.Usage.System, uint64((25 * time.Millisecond).Nanoseconds()), "User + system CPU usage")
inDelta(t, stat.Usage.Total, stat.Usage.User+stat.Usage.System, uint64((500 * time.Millisecond).Nanoseconds()), "User + system CPU usage")
assert.Equal(0, stat.Load, "Non-zero load is unexpected as it is currently unset. Do we need to update the test?")
}