Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions batch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ func TestTxSendBatchRollback(t *testing.T) {
id serial primary key,
description varchar not null
);`
pgxtest.SkipYugabyteDB(t, conn, "Flaky test failure on YugabyteDB")
mustExec(t, conn, sql)

tx, _ := conn.Begin(ctx)
Expand Down
14 changes: 12 additions & 2 deletions conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ func TestPrepareIdempotency(t *testing.T) {

pgxtest.RunWithQueryExecModes(ctx, t, defaultConnTestRunner, nil, func(ctx context.Context, t testing.TB, conn *pgx.Conn) {
for i := 0; i < 2; i++ {
pgxtest.SkipYugabyteDB(t, conn, "Flaky test failure on YugabyteDB")
_, err := conn.Prepare(context.Background(), "test", "select 42::integer")
if err != nil {
t.Fatalf("%d. Unable to prepare statement: %v", i, err)
Expand Down Expand Up @@ -593,6 +594,7 @@ func TestDeallocateMissingPreparedStatementStillClearsFromPreparedStatementMap(t
defer cancel()

pgxtest.RunWithQueryExecModes(ctx, t, defaultConnTestRunner, nil, func(ctx context.Context, t testing.TB, conn *pgx.Conn) {
pgxtest.SkipYugabyteDB(t, conn, "Flaky test failure on YugabyteDB")
_, err := conn.Prepare(ctx, "ps", "select $1::text")
require.NoError(t, err)

Expand Down Expand Up @@ -783,6 +785,7 @@ func TestFatalRxError(t *testing.T) {
defer closeConn(t, conn)

pgxtest.SkipCockroachDB(t, conn, "Server does not support pg_terminate_backend() (https://github.com/cockroachdb/cockroach/issues/35897)")
pgxtest.SkipYugabyteDB(t, conn, "Flaky test failure on YugabyteDB")

var wg sync.WaitGroup
wg.Add(1)
Expand Down Expand Up @@ -822,6 +825,7 @@ func TestFatalTxError(t *testing.T) {
defer closeConn(t, conn)

pgxtest.SkipCockroachDB(t, conn, "Server does not support pg_terminate_backend() (https://github.com/cockroachdb/cockroach/issues/35897)")
pgxtest.SkipYugabyteDB(t, conn, "Flaky test failure on YugabyteDB")

otherConn := mustConnectString(t, os.Getenv("PGX_TEST_DATABASE"))
defer otherConn.Close(context.Background())
Expand Down Expand Up @@ -868,6 +872,7 @@ func TestInsertTimestampArray(t *testing.T) {
defer cancel()

pgxtest.RunWithQueryExecModes(ctx, t, defaultConnTestRunner, nil, func(ctx context.Context, t testing.TB, conn *pgx.Conn) {
pgxtest.SkipYugabyteDB(t, conn, "Flaky test failure on YugabyteDB")
if results := mustExec(t, conn, "create temporary table foo(spice timestamp[]);"); results.String() != "CREATE TABLE" {
t.Error("Unexpected results from Exec")
}
Expand Down Expand Up @@ -955,7 +960,7 @@ func TestUnregisteredTypeUsableAsStringArgumentAndBaseResult(t *testing.T) {
pgxtest.RunWithQueryExecModes(ctx, t, defaultConnTestRunner, nil, func(ctx context.Context, t testing.TB, conn *pgx.Conn) {
pgxtest.SkipCockroachDB(t, conn, "Server does support domain types (https://github.com/cockroachdb/cockroach/issues/27796)")
pgxtest.SkipYugabyteDB(t, conn, "YugabyteDB does not support uint64 domain type")

var n uint64
err := conn.QueryRow(context.Background(), "select $1::uint64", "42").Scan(&n)
if err != nil {
Expand Down Expand Up @@ -1061,7 +1066,7 @@ func TestLoadCompositeType(t *testing.T) {
pgxtest.RunWithQueryExecModes(ctx, t, defaultConnTestRunner, nil, func(ctx context.Context, t testing.TB, conn *pgx.Conn) {
pgxtest.SkipCockroachDB(t, conn, "Server does support composite types (https://github.com/cockroachdb/cockroach/issues/27792)")
pgxtest.SkipYugabyteDB(t, conn, "ALTER TYPE DROP ATTRIBUTE not supported yet in YugabyteDB")

tx, err := conn.Begin(ctx)
require.NoError(t, err)
defer tx.Rollback(ctx)
Expand Down Expand Up @@ -1174,6 +1179,8 @@ func TestStmtCacheInvalidationConn(t *testing.T) {
conn := mustConnectString(t, os.Getenv("PGX_TEST_DATABASE"))
defer closeConn(t, conn)

pgxtest.SkipYugabyteDB(t, conn, "Flaky test failure on YugabyteDB")

// create a table and fill it with some data
_, err := conn.Exec(ctx, `
DROP TABLE IF EXISTS drop_cols;
Expand Down Expand Up @@ -1235,6 +1242,7 @@ func TestStmtCacheInvalidationTx(t *testing.T) {

conn := mustConnectString(t, os.Getenv("PGX_TEST_DATABASE"))
defer closeConn(t, conn)
pgxtest.SkipYugabyteDB(t, conn, "Flaky test failure on YugabyteDB")

if conn.PgConn().ParameterStatus("crdb_version") != "" {
t.Skip("Server has non-standard prepare in errored transaction behavior (https://github.com/cockroachdb/cockroach/issues/84140)")
Expand Down Expand Up @@ -1318,6 +1326,7 @@ func TestStmtCacheInvalidationConnWithBatch(t *testing.T) {
if conn.PgConn().ParameterStatus("crdb_version") != "" {
t.Skip("Test fails due to different CRDB behavior")
}
pgxtest.SkipYugabyteDB(t, conn, "Flaky test failure on YugabyteDB")

// create a table and fill it with some data
_, err := conn.Exec(ctx, `
Expand Down Expand Up @@ -1390,6 +1399,7 @@ func TestStmtCacheInvalidationTxWithBatch(t *testing.T) {

conn := mustConnectString(t, os.Getenv("PGX_TEST_DATABASE"))
defer closeConn(t, conn)
pgxtest.SkipYugabyteDB(t, conn, "Flaky test failure on YugabyteDB")

if conn.PgConn().ParameterStatus("crdb_version") != "" {
t.Skip("Server has non-standard prepare in errored transaction behavior (https://github.com/cockroachdb/cockroach/issues/84140)")
Expand Down
10 changes: 10 additions & 0 deletions pgconn/pgconn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,10 @@ func TestConnDeallocate(t *testing.T) {
require.NoError(t, err)
defer closeConn(t, pgConn)

if strings.Contains(pgConn.ParameterStatus("server_version"), "YB") {
t.Skip("Flaky test failure on YugabyteDB")
}

_, err = pgConn.Prepare(ctx, "ps1", "select 1", nil)
require.NoError(t, err)

Expand Down Expand Up @@ -714,6 +718,9 @@ func TestConnDeallocateSucceedsInAbortedTransaction(t *testing.T) {
pgConn, err := pgconn.Connect(ctx, os.Getenv("PGX_TEST_DATABASE"))
require.NoError(t, err)
defer closeConn(t, pgConn)
if strings.Contains(pgConn.ParameterStatus("server_version"), "YB") {
t.Skip("Flaky test failure on YugabyteDB")
}

err = pgConn.Exec(ctx, "begin").Close()
require.NoError(t, err)
Expand Down Expand Up @@ -2923,6 +2930,9 @@ func TestPipelinePrepareAndDeallocate(t *testing.T) {
pgConn, err := pgconn.Connect(ctx, os.Getenv("PGX_TEST_DATABASE"))
require.NoError(t, err)
defer closeConn(t, pgConn)
if strings.Contains(pgConn.ParameterStatus("server_version"), "YB") {
t.Skip("Flaky test failure on YugabyteDB")
}

pipeline := pgConn.StartPipeline(ctx)
pipeline.SendPrepare("selectInt", "select $1::bigint as a", nil)
Expand Down
1 change: 1 addition & 0 deletions pgxpool/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ func TestPoolAcquireChecksIdleConns(t *testing.T) {
require.NoError(t, err)
defer controllerConn.Close(ctx)
pgxtest.SkipCockroachDB(t, controllerConn, "Server does not support pg_terminate_backend() (https://github.com/cockroachdb/cockroach/issues/35897)")
pgxtest.SkipYugabyteDB(t, controllerConn, "Flaky test failure on YugabyteDB")

pool, err := pgxpool.New(ctx, os.Getenv("PGX_TEST_DATABASE"))
require.NoError(t, err)
Expand Down
3 changes: 3 additions & 0 deletions stdlib/sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ func TestQueryCloseRowsEarly(t *testing.T) {

func TestConnExec(t *testing.T) {
testWithAllQueryExecModes(t, func(t *testing.T, db *sql.DB) {
skipYugabyteDB(t, db, "Flaky test on YugabyteDB")
_, err := db.Exec("create temporary table t(a varchar not null)")
require.NoError(t, err)

Expand Down Expand Up @@ -826,6 +827,7 @@ func TestConnPrepareContextSuccess(t *testing.T) {
func TestConnMultiplePrepareAndDeallocate(t *testing.T) {
testWithAllQueryExecModes(t, func(t *testing.T, db *sql.DB) {
skipCockroachDB(t, db, "Server does not support pg_prepared_statements")
skipYugabyteDB(t, db, "Flaky test failure on YugabyteDB")

sql := "select 42"
stmt1, err := db.PrepareContext(context.Background(), sql)
Expand Down Expand Up @@ -1338,6 +1340,7 @@ func TestCheckIdleConn(t *testing.T) {
defer closeDB(t, controllerConn)

skipCockroachDB(t, controllerConn, "Server does not support pg_terminate_backend() (https://github.com/cockroachdb/cockroach/issues/35897)")
skipYugabyteDB(t, controllerConn, "Flaky test in YugabyteDB")

db, err := sql.Open("pgx", os.Getenv("PGX_TEST_DATABASE"))
require.NoError(t, err)
Expand Down
Loading