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

Method TestPoolMaxSize

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

Source from the content-addressed store, hash-verified

35}
36
37func (t *PoolTest) TestPoolMaxSize(c *C) {
38 N := 1000
39
40 perform(N, func(int) {
41 _, err := t.db.Exec("SELECT 'test_pool_max_size'")
42 c.Assert(err, IsNil)
43 })
44
45 c.Assert(t.db.Pool().Len(), Equals, 10)
46 c.Assert(t.db.Pool().IdleLen(), Equals, 10)
47}
48
49func (t *PoolTest) TestCloseClosesAllConnections(c *C) {
50 ln := t.db.Listen(ctx, "test_channel")

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected