diff --git a/batch_test.go b/batch_test.go index afa6ad6bb..671dadf03 100644 --- a/batch_test.go +++ b/batch_test.go @@ -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) diff --git a/conn_test.go b/conn_test.go index eb997422e..9096a56ea 100644 --- a/conn_test.go +++ b/conn_test.go @@ -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) @@ -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) @@ -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) @@ -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()) @@ -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") } @@ -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 { @@ -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) @@ -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; @@ -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)") @@ -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, ` @@ -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)") diff --git a/pgconn/pgconn_test.go b/pgconn/pgconn_test.go index d6f34e70b..08e044135 100644 --- a/pgconn/pgconn_test.go +++ b/pgconn/pgconn_test.go @@ -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) @@ -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) @@ -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) diff --git a/pgxpool/pool_test.go b/pgxpool/pool_test.go index 9e98d6e59..61f8a1943 100644 --- a/pgxpool/pool_test.go +++ b/pgxpool/pool_test.go @@ -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) diff --git a/stdlib/sql_test.go b/stdlib/sql_test.go index dd24817d7..e87eab842 100644 --- a/stdlib/sql_test.go +++ b/stdlib/sql_test.go @@ -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) @@ -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) @@ -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)