MCPcopy Create free account
hub / github.com/go-pg/pg / TestPoolReusesConnection

Method TestPoolReusesConnection

pool_test.go:27–35  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

25}
26
27func (t *PoolTest) TestPoolReusesConnection(c *C) {
28 for i := 0; i < 100; i++ {
29 _, err := t.db.Exec("SELECT 'test_pool_reuses_connection'")
30 c.Assert(err, IsNil)
31 }
32
33 c.Assert(t.db.Pool().Len(), Equals, 1)
34 c.Assert(t.db.Pool().IdleLen(), Equals, 1)
35}
36
37func (t *PoolTest) TestPoolMaxSize(c *C) {
38 N := 1000

Callers

nothing calls this directly

Calls 5

AssertMethod · 0.80
PoolMethod · 0.80
ExecMethod · 0.65
LenMethod · 0.65
IdleLenMethod · 0.65

Tested by

no test coverage detected