Parcourir la source

Merge pull request #2826 from yichengq/fix-wait-test

pkg/wait: fix TestWaitTestStress
Xiang Li il y a 11 ans
Parent
commit
1a9dcd2f72
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      pkg/wait/wait_time_test.go

+ 2 - 0
pkg/wait/wait_time_test.go

@@ -53,6 +53,8 @@ func TestWaitTestStress(t *testing.T) {
 	wt := NewTimeList()
 	for i := 0; i < 10000; i++ {
 		chs = append(chs, wt.Wait(time.Now()))
+		// sleep one nanosecond before waiting on the next event
+		time.Sleep(time.Nanosecond)
 	}
 	wt.Trigger(time.Now())