MCPcopy
hub / github.com/jackc/pgx / TestPoolAcquireAndConnRelease

Function TestPoolAcquireAndConnRelease

pgxpool/pool_test.go:112–125  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

110}
111
112func TestPoolAcquireAndConnRelease(t *testing.T) {
113 t.Parallel()
114
115 ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second)
116 defer cancel()
117
118 pool, err := pgxpool.New(ctx, os.Getenv("PGX_TEST_DATABASE"))
119 require.NoError(t, err)
120 defer pool.Close()
121
122 c, err := pool.Acquire(ctx)
123 require.NoError(t, err)
124 c.Release()
125}
126
127func TestPoolAcquireAndConnHijack(t *testing.T) {
128 t.Parallel()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.92
AcquireMethod · 0.80
ReleaseMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected