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

Function TestPoolSendBatch

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

Source from the content-addressed store, hash-verified

853}
854
855func TestPoolSendBatch(t *testing.T) {
856 t.Parallel()
857
858 ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second)
859 defer cancel()
860
861 pool, err := pgxpool.New(ctx, os.Getenv("PGX_TEST_DATABASE"))
862 require.NoError(t, err)
863 defer pool.Close()
864
865 testSendBatch(t, ctx, pool)
866 waitForReleaseToComplete()
867
868 stats := pool.Stat()
869 assert.EqualValues(t, 0, stats.AcquiredConns())
870 assert.EqualValues(t, 1, stats.TotalConns())
871}
872
873func TestPoolCopyFrom(t *testing.T) {
874 // Not able to use testCopyFrom because it relies on temporary tables and the pool may run subsequent calls under

Callers

nothing calls this directly

Calls 7

NewFunction · 0.92
testSendBatchFunction · 0.85
waitForReleaseToCompleteFunction · 0.85
StatMethod · 0.80
AcquiredConnsMethod · 0.80
TotalConnsMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected