Skip to content

Commit 1983543

Browse files
committed
add tests
Signed-off-by: Mohamed Hamza <[email protected]>
1 parent dca5161 commit 1983543

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

go/vt/vttablet/tabletserver/connpool/pool_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,22 @@ func TestReopenPool(t *testing.T) {
6464

6565
connPool := NewPool(env, "TestPool", cfg)
6666
connPool.Open(params, params, params)
67+
68+
dbConn, err := connPool.Get(context.Background(), nil)
69+
require.NoError(t, err)
70+
require.NotNil(t, dbConn)
71+
72+
dbConn.Recycle()
6773
connPool.Close()
6874

6975
connPool = NewPool(env, "TestPool", cfg)
7076
connPool.Open(params, params, params)
77+
78+
dbConn, err = connPool.Get(context.Background(), nil)
79+
require.NoError(t, err)
80+
require.NotNil(t, dbConn)
81+
82+
dbConn.Recycle()
7183
connPool.Close()
7284
}
7385

@@ -85,10 +97,22 @@ func TestReopenPoolUnnamedEnv(t *testing.T) {
8597

8698
connPool := NewPool(env, "TestPool", cfg)
8799
connPool.Open(params, params, params)
100+
101+
dbConn, err := connPool.Get(context.Background(), nil)
102+
require.NoError(t, err)
103+
require.NotNil(t, dbConn)
104+
105+
dbConn.Recycle()
88106
connPool.Close()
89107

90108
connPool = NewPool(env, "TestPool", cfg)
91109
connPool.Open(params, params, params)
110+
111+
dbConn, err = connPool.Get(context.Background(), nil)
112+
require.NoError(t, err)
113+
require.NotNil(t, dbConn)
114+
115+
dbConn.Recycle()
92116
connPool.Close()
93117
}
94118

0 commit comments

Comments
 (0)