mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 05:07:44 +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()
|
go s.Run()
|
||||||
defer func() {
|
defer s.Close()
|
||||||
s.Close()
|
time.Sleep(500 * time.Millisecond)
|
||||||
}()
|
|
||||||
time.Sleep(100 * time.Millisecond)
|
|
||||||
gtest.Case(t, func() {
|
gtest.Case(t, func() {
|
||||||
conn, err := gtcp.NewPoolConn(fmt.Sprintf("127.0.0.1:%d", p))
|
conn, err := gtcp.NewPoolConn(fmt.Sprintf("127.0.0.1:%d", p))
|
||||||
gtest.Assert(err, nil)
|
gtest.Assert(err, nil)
|
||||||
@ -49,10 +47,8 @@ func Test_Pool_Basic2(t *testing.T) {
|
|||||||
conn.Close()
|
conn.Close()
|
||||||
})
|
})
|
||||||
go s.Run()
|
go s.Run()
|
||||||
defer func() {
|
defer s.Close()
|
||||||
s.Close()
|
time.Sleep(500 * time.Millisecond)
|
||||||
}()
|
|
||||||
time.Sleep(100 * time.Millisecond)
|
|
||||||
gtest.Case(t, func() {
|
gtest.Case(t, func() {
|
||||||
conn, err := gtcp.NewPoolConn(fmt.Sprintf("127.0.0.1:%d", p))
|
conn, err := gtcp.NewPoolConn(fmt.Sprintf("127.0.0.1:%d", p))
|
||||||
gtest.Assert(err, nil)
|
gtest.Assert(err, nil)
|
||||||
|
Loading…
Reference in New Issue
Block a user