fix: TestSleepStrict

This commit is contained in:
lilong.129
2023-08-24 21:18:01 +08:00
parent 02a2d800e5
commit be87a2cdcc
3 changed files with 17 additions and 7 deletions
+2 -2
View File
@@ -40,7 +40,7 @@ func TestSleepStrict(t *testing.T) {
sleepStrict(startTime, 1230)
dur := time.Since(startTime).Milliseconds()
t.Log(dur)
if dur < 1230 || dur > 1232 {
t.Fatal("sleepRandom failed")
if dur <= 1230 || dur > 1232 {
t.Fatalf("sleepRandom failed, dur: %d", dur)
}
}