diff --git a/net/gtcp/gtcp_unit_pool_test.go b/net/gtcp/gtcp_unit_pool_test.go index 3cbaea6fe..e7bd7a495 100644 --- a/net/gtcp/gtcp_unit_pool_test.go +++ b/net/gtcp/gtcp_unit_pool_test.go @@ -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)