Pārlūkot izejas kodu

pkg/wait: extend timeout to check closed channel

It is possible to trigger the time.After case if the timer went off
between time.After setting the timer for its channel and the time that
select looked at the channel. So it needs to be longer.

refer: https://groups.google.com/forum/#!topic/golang-nuts/1tjcV80ccq8
Yicheng Qin 11 gadi atpakaļ
vecāks
revīzija
eea7f28be4
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      pkg/wait/wait_time_test.go

+ 1 - 1
pkg/wait/wait_time_test.go

@@ -61,7 +61,7 @@ func TestWaitTestStress(t *testing.T) {
 	for _, ch := range chs {
 	for _, ch := range chs {
 		select {
 		select {
 		case <-ch:
 		case <-ch:
-		case <-time.After(10 * time.Millisecond):
+		case <-time.After(time.Second):
 			t.Fatalf("cannot receive from ch as expected")
 			t.Fatalf("cannot receive from ch as expected")
 		}
 		}
 	}
 	}