mirror of
https://gitee.com/johng/gf.git
synced 2024-12-03 12:47:50 +08:00
fix data race issue in unit testing of gtcp
This commit is contained in:
parent
2d754f80b1
commit
58a25c6f61
@ -27,10 +27,8 @@ func Test_Pool_Basic1(t *testing.T) {
|
||||
}
|
||||
})
|
||||
go s.Run()
|
||||
defer func() {
|
||||
s.Close()
|
||||
}()
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
defer s.Close()
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
gtest.Case(t, func() {
|
||||
conn, err := gtcp.NewPoolConn(fmt.Sprintf("127.0.0.1:%d", p))
|
||||
gtest.Assert(err, nil)
|
||||
@ -49,10 +47,8 @@ func Test_Pool_Basic2(t *testing.T) {
|
||||
conn.Close()
|
||||
})
|
||||
go s.Run()
|
||||
defer func() {
|
||||
s.Close()
|
||||
}()
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
defer s.Close()
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
gtest.Case(t, func() {
|
||||
conn, err := gtcp.NewPoolConn(fmt.Sprintf("127.0.0.1:%d", p))
|
||||
gtest.Assert(err, nil)
|
||||
|
Loading…
Reference in New Issue
Block a user