diff --git a/support/db/dbtest/db.go b/support/db/dbtest/db.go index 18de073224..c0673813e4 100644 --- a/support/db/dbtest/db.go +++ b/support/db/dbtest/db.go @@ -128,8 +128,8 @@ func checkReadOnly(t testing.TB, DSN string) { if !rows.Next() { _, err = tx.Exec("CREATE ROLE user_ro WITH LOGIN PASSWORD 'user_ro';") if err != nil { - // Handle race condition by ignoring the error if it's a duplicate key violation - if pqErr, ok := err.(*pq.Error); ok && pqErr.Code == "23505" { + // Handle race condition by ignoring the error if it's a duplicate key violation or duplicate object error + if pqErr, ok := err.(*pq.Error); ok && (pqErr.Code == "23505" || pqErr.Code == "42710") { return } }