Skip backend PID dependent tests on CockroachDB

pull/955/head
Jack Christensen 2021-02-27 10:03:58 -06:00
parent 1e15bdc874
commit 2b63da6f12
1 changed files with 30 additions and 0 deletions

View File

@ -228,6 +228,20 @@ func TestPoolBeforeAcquire(t *testing.T) {
func TestPoolAfterRelease(t *testing.T) {
t.Parallel()
func() {
pool, err := pgxpool.Connect(context.Background(), os.Getenv("PGX_TEST_DATABASE"))
require.NoError(t, err)
defer pool.Close()
err = pool.AcquireFunc(context.Background(), func(conn *pgxpool.Conn) error {
if conn.Conn().PgConn().ParameterStatus("crdb_version") != "" {
t.Skip("Server does not support backend PID")
}
return nil
})
require.NoError(t, err)
}()
config, err := pgxpool.ParseConfig(os.Getenv("PGX_TEST_DATABASE"))
require.NoError(t, err)
@ -533,6 +547,14 @@ func TestConnReleaseClosesConnInFailedTransaction(t *testing.T) {
require.NoError(t, err)
defer pool.Close()
err = pool.AcquireFunc(ctx, func(conn *pgxpool.Conn) error {
if conn.Conn().PgConn().ParameterStatus("crdb_version") != "" {
t.Skip("Server does not support backend PID")
}
return nil
})
require.NoError(t, err)
c, err := pool.Acquire(ctx)
require.NoError(t, err)
@ -571,6 +593,14 @@ func TestConnReleaseClosesConnInTransaction(t *testing.T) {
require.NoError(t, err)
defer pool.Close()
err = pool.AcquireFunc(ctx, func(conn *pgxpool.Conn) error {
if conn.Conn().PgConn().ParameterStatus("crdb_version") != "" {
t.Skip("Server does not support backend PID")
}
return nil
})
require.NoError(t, err)
c, err := pool.Acquire(ctx)
require.NoError(t, err)