Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable the repair tests on PG versions that do not support it #1857

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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