Skip to content

Commit 26b9e29

Browse files
author
zhaohuiliu
committed
fix TestBackgroundPing
1 parent b2088c6 commit 26b9e29

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pipe_test.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -5324,9 +5324,6 @@ func TestBackgroundPing(t *testing.T) {
53245324
DisableAutoPipelining: true}
53255325
p, mock, cancel, _ := setup(t, opt)
53265326
defer cancel()
5327-
go func() {
5328-
mock.Expect("PING").ReplyString("OK")
5329-
}()
53305327
time.Sleep(50*time.Millisecond)
53315328
prev := atomic.LoadInt32(&p.recvs)
53325329

@@ -5340,10 +5337,12 @@ func TestBackgroundPing(t *testing.T) {
53405337
}
53415338
}
53425339

5343-
for i := range 10 {
5344-
go func() {
5340+
go func() {
5341+
for range 10 {
53455342
mock.Expect("PING").ReplyString("OK")
5346-
}()
5343+
}
5344+
}()
5345+
for i := range 10 {
53475346
time.Sleep(timeout)
53485347
recv := atomic.LoadInt32(&p.recvs)
53495348
if prev == recv {

0 commit comments

Comments
 (0)