Skip to content

Commit

Permalink
Merge pull request authzed#1857 from josephschorr/disable-repair-test
Browse files Browse the repository at this point in the history
Disable the repair tests on PG versions that do not support it
  • Loading branch information
josephschorr committed Apr 4, 2024
2 parents c44075b + 58c9fbb commit d73b0ac
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion internal/datastore/postgres/postgres_shared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1377,12 +1377,22 @@ func RepairTransactionsTest(t *testing.T, ds datastore.Datastore) {
// Break the datastore by adding a transaction entry with an XID greater the current one.
pds := ds.(*pgDatastore)

getVersionQuery := fmt.Sprintf("SELECT version()")
var version string
err := pds.writePool.QueryRow(context.Background(), getVersionQuery).Scan(&version)
require.NoError(t, err)

if strings.HasPrefix(version, "PostgreSQL 13.") || strings.HasPrefix(version, "PostgreSQL 14.") {
t.Skip("Skipping test on PostgreSQL 13 and 14 as they do not support xid8 max")
return
}

createLaterTxn := fmt.Sprintf(
"INSERT INTO %s (\"xid\") VALUES (12345::text::xid8)",
tableTransaction,
)

_, err := pds.writePool.Exec(context.Background(), createLaterTxn)
_, err = pds.writePool.Exec(context.Background(), createLaterTxn)
require.NoError(t, err)

// Run the repair code.
Expand Down

0 comments on commit d73b0ac

Please sign in to comment.