fix: TestSleepStrict

This commit is contained in:
lilong.129
2023-08-24 21:33:11 +08:00
parent be87a2cdcc
commit f7eb196a8e
8 changed files with 40 additions and 12 deletions

View File

@@ -9,7 +9,7 @@ func TestGenDemoExamples(t *testing.T) {
dir := "../../../examples/demo-with-go-plugin"
err := CreateScaffold(dir, Go, "", true)
if err != nil {
t.Fatal()
t.Fatal(err)
}
// FIXME
@@ -17,18 +17,18 @@ func TestGenDemoExamples(t *testing.T) {
venv := filepath.Join(dir, ".venv")
err = CreateScaffold(dir, Py, venv, true)
if err != nil {
t.Fatal()
t.Fatal(err)
}
dir = "../../../examples/demo-without-plugin"
err = CreateScaffold(dir, Ignore, "", true)
if err != nil {
t.Fatal()
t.Fatal(err)
}
dir = "../../../examples/demo-empty-project"
err = CreateScaffold(dir, Empty, "", true)
if err != nil {
t.Fatal()
t.Fatal(err)
}
}

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 {
if dur < 1230 || dur > 1240 {
t.Fatalf("sleepRandom failed, dur: %d", dur)
}
}